Cmd-H Inc. (“Hebbia”, “we”, “us”, or “our”) uses artificial intelligence to power in-page search that allows our users and customers to locate relevant content more effectively and efficiently. This Privacy Policy is designed to help you understand how we collect, use, and share your personal information and to help you understand and exercise your privacy rights. Cmd-H is the controller for the personal information we process, unless otherwise stated. For information on how to contact us, please refer to Section 13 below.
This Privacy Policy applies to personal information processed by us, including on our websites and other online or offline offerings. To make this Privacy Policy easier to read, our websites and other offerings are collectively called “Services”.
This Privacy Policy does not apply to any of the personal information that our customers may process using Hebbia’s products and services (“Customer Data”). Our customers’ respective privacy policies govern the collection and use of Customer Data. Our processing of Customer Data is governed by the contracts that we have in place with our customers, not this Privacy Policy. Any questions or requests relating to Customer Data should be directed to our customer.
The categories of personal information we collect depend on how you interact with us, our Services and the requirements of applicable law. We collect information that you provide to us, information we obtain automatically when you use our Services, and information from other sources such as third-party services and organizations, as described below.
We may collect the following personal information that you provide to us.
Account Creation. We may collect information when you create an account, such as name, email address, and type of user (e.g., student, research, analyst).
Purchases. We may collect personal information and details associated with your purchases, including payment information. Any payments made via our Services are processed by third-party payment processors. We do not directly collect or store any payment card information entered through our Services but may receive information associated with your payment card information (e.g., your billing details).
Your Communications with Us. We may collect personal information, such as email address, phone number, or mailing address when you request information about our Services, register for our newsletter, request customer or technical support, apply for a job or otherwise communicate with us.
Surveys. We may contact you to participate in surveys. If you decide to participate, you may be asked to provide certain information which may include personal information.
Interactive Features. We and others who use our Services may collect personal information that you submit or make available through our interactive features (e.g., messaging and chat features, commenting functionalities, forums, blogs, and social media pages). Any information you provide on the public sections of these features will be considered “public”, unless otherwise required by applicable law, and is not subject to the privacy protections referenced herein.
Sweepstakes or Contests. We may collect personal information you provide for any sweepstakes or contests that we offer. In some jurisdictions, we are required to publicly share information of sweepstakes and contest winners.
Conferences, Trade Shows, and Other Events. We may collect personal information from individuals when we attend conferences, trade shows, webinars, and other events.
Business Development and Strategic Partnerships. We may collect personal information from individuals and third parties to assess and pursue potential business opportunities.
Job Applications. We may post job openings and opportunities on our Services. If you reply to one of these postings by submitting your application, CV and/or cover letter to us, we will collect and use your information to assess your qualifications.
We may collect the following personal information that you provide to us.
Automatic Data Collection. We may collect certain information automatically when you use our Services, such as your Internet protocol (IP) address, user settings, MAC address, cookie identifiers, mobile carrier, mobile advertising and other unique identifiers, browser or device information, location information (including approximate location derived from IP address), and Internet service provider. We may also automatically collect information regarding your use of our Services, such as pages that you visit before, during and after using our Services, information about the links you click, the types of content you interact with, the frequency and duration of your activities, and other information about how you use our Services. In addition, we may collect information that other people provide about you when they use our Services, including information about you when they tag you.
Cookies, Pixel Tags/Web Beacons, and Other Technologies. We, as well as third parties that provide content, advertising, or other functionality on our Services, may use cookies, pixel tags, local storage, and other technologies (“Technologies”) to automatically collect information through your use of our Services.
Cookies. Cookies are small text files placed in device browsers that store preferences and facilitate and enhance your experience.
Pixel Tags/Web Beacons. A pixel tag (also known as a web beacon) is a piece of code embedded in our Services that collects information about engagement on our Services. The use of a pixel tag allows us to record, for example, that a user has visited a particular web page or clicked on a particular advertisement. We may also include web beacons in e-mails to understand whether messages have been opened, acted on, or forwarded.
Our uses of these Technologies fall into the following general categories:
Operationally Necessary. This includes Technologies that allow you access to our Services, applications, and tools that are required to identify irregular website behavior, prevent fraudulent activity and improve security or that allow you to make use of our functionality.
Performance-Related. We may use Technologies to assess the performance of our Services, including as part of our analytic practices to help us understand how individuals use our Services (see Analytics below).
Functionality-Related. We may use Technologies that allow us to offer you enhanced functionality when accessing or using our Services. This may include identifying you when you sign into our Services or keeping track of your specified preferences, interests, or past items viewed.
Advertising- or Targeting-Related. We may use first party or third-party Technologies to deliver content, including ads relevant to your interests, on our Services or on third-party websites.
See Section 5 below to understand your choices regarding these Technologies.
Analytics. We may use Technologies and other third-party tools to process analytics information on our Services. Some of our analytics partners include:
Google Analytics. For more information, please visit Google Analytics’ Privacy Policy. To learn more about how to opt-out of Google Analytics’ use of your information, please click here.
LinkedIn Analytics. For more information, please visit LinkedIn Analytics’ Privacy Policy. To learn more about how to opt-out of LinkedIn's use of your information, please click here.
Mixpanel. For more information about Mixpanel, please visit LinkedIn Analytics’ Privacy Policy.
Social Media Platforms. Our Services may contain social media buttons such as Twitter, Facebook, and Instagram (that might include widgets such as the “share this” button or other interactive mini programs). These features may collect your IP address, which page you are visiting on our Services, and may set a cookie to enable the feature to function properly. Your interactions with these platforms are governed by the privacy policy of the company providing it.
We may obtain information about you from other sources, including through referrals made by someone you know or from third-party services and organizations. For example, if you access our Services through a third-party application, such as an app store, a third-party login service, or a social networking site, we may collect information about you from that third-party application that you have made available via your privacy settings.
We use your information for a variety of business purposes, including to provide our Services, for administrative purposes, and to market our products and Services, as described below.
We use your information to fulfil our contract with you and provide you with our Services, such as:
Managing your information and accounts
Providing access to certain areas, functionalities, and features of our Services
Answering requests for customer or technical support
Communicating with you about your account, activities on our Services, and policy changes
Processing your financial information and other payment methods for products or Services purchased
Processing applications if you apply for a job, we post on our Services
Allowing you to register for events
We use your information for various administrative purposes, such as:
Pursuing our legitimate interests such as direct marketing, research and development (including marketing research), network and information security, and fraud prevention
Detecting security incidents, protecting against malicious, deceptive, fraudulent or illegal activity, and prosecuting those responsible for that activity
Measuring interest and engagement in our Services
Short-term, transient use, such as contextual customization of ads
Improving, upgrading or enhancing our Services
Developing new products and Services
Ensuring internal quality control and safety
Authenticating and verifying individual identities
Debugging to identify and repair errors with our Services
Auditing relating to interactions, transactions and other compliance activities
Enforcing our agreements and policies
Complying with our legal obligations
We may use personal information to tailor and provide you with content and advertisements. We may provide you with these materials as permitted by applicable law.
Some of the ways we market to you include email campaigns, custom audiences advertising, and “interest-based” or “personalized advertising,” including through cross-device tracking.
If you have any questions about our marketing practices or if you would like to opt out of the use of your personal information for marketing purposes, you may contact us at any time as set forth below.
We also use your information for other purposes as requested by you or as permitted by applicable law.
Consent. We may use personal information for other purposes that are clearly disclosed to you at the time you provide personal information or with your consent.
De-identified and Aggregated Information. We may use personal information and other information about you to create de-identified and/or aggregated information, such as de-identified demographic information, de-identified location information, information about the device from which you access our Services, or other analyses we create.
Share Content with Friends or Colleagues. Our Services may offer various tools and functionalities. For example, we may allow you to provide information about your friends or colleagues through our referral services. Our referral services may allow you to forward or share certain content with a friend or colleague, such as an email inviting your friend to use our Services.
We disclose your information to third parties for a variety of business purposes, including to provide our Services, to protect us or others, or in the event of a major business transaction such as a merger, sale, or asset transfer, as described below.
The categories of third parties with whom we may share your information are described below.
Service Providers. We may share your personal information with our third-party service providers who use that information to help us provide our Services. This includes service providers that provide us with IT support, hosting, payment processing, customer service, and related services.
Business Partners. We may share your personal information with business partners to provide you with a product or service you have requested. We may also share your personal information to business partners with whom we jointly offer products or services.
Advertising Partners. We may share your personal information with third-party advertising partners. These third-party advertising partners may set Technologies and other tracking tools on our Services to collect information regarding your activities and your device (e.g., your IP address, cookie identifiers, page(s) visited, location, time of day). These advertising partners may use this information (and similar information collected from other services) for purposes of delivering personalized advertisements to you when you visit digital properties within their networks. This practice is commonly referred to as “interest-based advertising” or “personalized advertising.”
APIs/SDKs. We may use third-party Application Program Interfaces (“APIs”) and software development kits (“SDKs”) as part of the functionality of our Services, such as for user login purposes. For more information about our use of APIs and SDKs, please contact us as set forth below.
We may access, preserve, and disclose any information we store associated with you to external parties if we, in good faith, believe doing so is required or appropriate to: comply with law enforcement or national security requests and legal process, such as a court order or subpoena; protect your, our, or others’ rights, property, or safety; enforce our policies or contracts; collect amounts owed to us; or assist with an investigation or prosecution of suspected or actual illegal activity.
If we are involved in a merger, acquisition, financing due diligence, reorganization, bankruptcy, receivership, purchase or sale of assets, or transition of service to another provider, your information may be sold or transferred as part of such a transaction, as permitted by law and/or contract.
Your Privacy Choices. The privacy choices you may have about your personal information are determined by applicable law and are described below.
Email and Telephone Communications. If you receive an unwanted email from us, you can use the unsubscribe link found at the bottom of the email to opt out of receiving future emails. Note that you will continue to receive transaction-related emails regarding products or Services you have requested. We may also send you certain non-promotional communications regarding us and our Services, and you will not be able to opt out of those communications (e.g., communications regarding our Services or updates to our Terms or this Privacy Policy).
We process requests to be placed on do-not-mail, do-not-phone, and do-not-contact lists as required by applicable law.
“Do Not Track." Do Not Track (“DNT”) is a privacy preference that users can set in certain web browsers. Please note that we do not respond to or honor DNT signals or similar mechanisms transmitted by web browsers.
Cookies and Interest-Based Advertising. You may stop or restrict the placement of Technologies on your device or remove them by adjusting your preferences as your browser or device permits. However, if you adjust your preferences, our Services may not work properly.
The online advertising industry also provides websites from which you may opt out of receiving targeted ads from data partners and other advertising partners that participate in self-regulatory programs. You can access these and learn more about targeted advertising and consumer choice and privacy by visiting the Network Advertising Initiative, the Digital Advertising Alliance, the European Digital Advertising Alliance, and the Digital Advertising Alliance of Canada.
Please note you must separately opt out in each browser and on each device.
Your Privacy Rights. In accordance with applicable law, you may have the right to:
Access Personal Information about you, including: (i) confirming whether we are processing your personal information; (ii) obtaining access to or a copy of your personal information.
Request Correction of your personal information where it is inaccurate, incomplete or outdated. In some cases, we may provide self-service tools that enable you to update your personal information.
Request Deletion, Anonymization or Blocking of your personal information when processing is based on your consent or when processing is unnecessary, excessive or noncompliant.
Request Restriction of or Object to our processing of your personal information when processing is noncompliant.
Withdraw your Consent to our processing of your personal information. If you refrain from providing personal information or withdraw your consent to processing, some features of our Service may not be available.
Request data portability and receive an electronic copy of personal information that you have provided to us.
Be informed about third parties with which your personal information has been shared.
Request the review of decisions taken exclusively based on automated processing if that could affect data subject rights.
If you would like to exercise any of these rights, please contact us as set forth below. We will process such requests in accordance with applicable laws.
We take steps to ensure that your information is treated securely and in accordance with this Privacy Policy. Unfortunately, no system is 100% secure, and we cannot ensure or warrant the security of any information you provide to us. We have taken appropriate safeguards to require that your personal information will remain protected and require our third-party service providers and partners to have appropriate safeguards as well. To the fullest extent permitted by applicable law, we do not accept liability for unauthorized disclosure.
By using our Services or providing personal information to us, you agree that we may communicate with you electronically regarding security, privacy, and administrative issues relating to your use of our Services. If we learn of a security system’s breach, we may attempt to notify you electronically by posting a notice on our Services, by mail or by sending an email to you.
All information processed by us may be transferred, processed, and stored anywhere in the world, including, but not limited to, the United States or other countries, which may have data protection laws that are different from the laws where you live. We endeavor to safeguard your information consistent with the requirements of applicable laws.
We store the personal information we collect as described in this Privacy Policy for as long as you use our Services or as necessary to fulfill the purpose(s) for which it was collected, provide our Services, resolve disputes, establish legal defenses, conduct audits, pursue legitimate business purposes, enforce our agreements, and comply with applicable laws.
This Supplemental California Privacy Notice only applies to our processing of personal information that is subject to the California Consumer Privacy Act of 2018 (“CCPA”). The CCPA provides California residents with the right to know what categories of personal information Cmd-H has collected about them and whether Cmd-H disclosed that personal information for a business purpose (e.g., to a service provider) in the preceding 12 months. California residents can find this information below:
| Category of Personal Information Collected by Hebbia | Category of Third Parties Information is Disclosed to for a Business Purpose |
|---|---|
|
Identifiers
|
|
|
Personal information categories listed in the California Customer Records statute
(Cal. Civ. Code § 1798.80(e))
|
|
|
Internet or other electronic network activity
|
|
|
Geolocation data
|
|
|
Professional or employment-related information
|
|
| Category of Personal Information Collected by Hebbia | Category of Third Parties Information is Disclosed to for a Business Purpose |
|---|---|
|
Inferences drawn from other personal information to create a profile about a consumer
|
|
The categories of sources from which we collect personal information and our business and commercial purposes for using personal information are set forth above.
For purposes of the CCPA, Cmd-H does not “sell” personal information, nor do we have actual knowledge of any “sale” of personal information of minors under 16 years of age.
Non-Discrimination. California residents have the right not to receive discriminatory treatment by us for the exercise of their rights conferred by the CCPA.
Authorized Agent. Only you, or someone legally authorized to act on your behalf, may make a verifiable consumer request related to your personal information. You may also make a verifiable consumer request on behalf of your minor child. To designate an authorized agent, please contact us as set forth below.
Verification. To protect your privacy, we will take steps the following steps to verify your identity before fulfilling your request. When you make a request, we will ask you to provide sufficient information that allows us to reasonably verify you are the person about whom we collected personal information or an authorized representative, which may include an email verification.
If you are a California resident and would like to exercise any of your rights under the CCPA, please contact us as set forth below. We will process such requests in accordance with applicable laws.
Accessibility. This Privacy Policy uses industry-standard technologies and was developed in line with the World Wide Web Consortium’s Web Content Accessibility Guidelines, version 2.1. If you wish to print this policy, please do so from your web browser or by saving the page as a PDF.
If you are a resident of Nevada, you have the right to opt-out of the sale of certain Personal Information to third parties who intend to license or sell that Personal Information. Please note that we do not currently sell your Personal Data as sales are defined in Nevada Revised Statutes Chapter 603A. For more information, please contact us as set forth below.
The Services are not directed to children under 14 (or other age as required by local law), and we do not knowingly collect personal information from children. If you are a parent or guardian and wish to review information collected from your child, or have that information modified or deleted, you may contact us as described below. If we become aware that a child has provided us with personal information in violation of applicable law, we will delete any personal information we have collected, unless we have a legal obligation to keep it, and terminate the child’s account.
Third-Party Websites/Applications. The Services may contain links to other websites/applications and other websites/applications may reference or link to our Services. These third-party services are not controlled by us. We encourage our users to read the privacy policies of each website and application with which they interact. We do not endorse, screen or approve, and are not responsible for, the privacy practices or content of such other websites or applications. Providing personal information to third-party websites or applications is at your own risk.
Supervisory Authority. If you are located in the European Economic Area, Switzerland, the United Kingdom or Brazil, you have the right to lodge a complaint with a supervisory authority if you believe our processing of your personal information violates applicable law.
Changes to our Privacy Policy. We may revise this Privacy Policy from time to time in our sole discretion. If there are any material changes to this Privacy Policy, we will notify you as required by applicable law. You understand and agree that you will be deemed to have accepted the updated Privacy Policy if you continue to use our Services after the new Privacy Policy takes effect.
If you have any questions about our privacy practices or this Privacy Policy, or to exercise your rights as detailed in this Privacy Policy, please contact us at:
Cmd-H Inc.
Data Protection Officer
privacy@
Hanover St,
Palo Alto, CA 94304


Setting up a dedicated MySQL server to host Ruby on Rails application servers, Ruby, Rails, MariaDB, MySQL, NoSQL, Scaling.
Scaling Ruby on Rails: Setting up a dedicated MySQL Server (part 2) - CentOS, Fedora
Difficulty: 4
Time: 1 hour
This article provides information about creating a database layer using MySQL to host application servers running Ruby on Rails.
Architecture of database server layer - an overview
To make the database server centrally accessible, you require a load-balancer, two application servers and one database server to set-up the database server layer. The architecture will look like the following diagram :
This articles will assist you in setting up a dedicated MySQL server and scaling Ruby on Rails applications between the servers in CentOS or Fedora Linux distributions.
Prerequisites
This article assumes that the host machine has Ruby on Rails using RVM installed and running. For more details, see:
This article is a part 2 article of the scaling Ruby on Rails series articles. To refer the first and third part, visit:
This article assumes that you are logged in as a sudo
user.
Install MySQL and other dependencies
- Update opeating system packages and install development tools.
sudo yum -y update
sudo yum groupinstall -y 'development tools'
- To use the YUM package, add the Extra Packages for Enterprise Linux (or EPEL) software repository.
sudo wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
sudo rpm -ivh epel-release-7-5.noarch.rpm
- Again update everything and install the required libraries.
sudo yum -y update
sudo yum install -y curl-devel vim sqlite-devel libyaml-devel
- Download and install the MySQL database server.
sudo yum install mysql-server mysql-devel
If MySQL server doesn't work, then try MariaDB.
sudo yum install MariaDB-server MariaDB-client
- Initiate the MySQL server daemon by typing :
sudo service mysqld start
Or
sudo /etc/init.d/mysql start
- Run the MySQL installation process by typing:
sudo/usr/bin/mysql_secure_installation
- After you have finished the above command, a welcome screen will display the following:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we will need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
If you have not created a password for root, create a new password by using the following command:
/usr/bin/mysqladmin -u root password 'new-password'
Press Enter.
Answer the following questions by pressing Y.
Set root password? --> Y
Remove anonymous users? --> Y
Disallow root login remotely? --> Y
Remove test database and access to it? --> Y
Reload privilege tables now? --> Y
Create a database, database user and database connection
- Establish database connection using MySQL client and enter the password for root that was previously set up.
sudo mysql -u root -p
- Create a sample database.
create database rails_Database_name;
- Create a new user for your database and grant remote and local access to this user.
CREATE USER 'rails_UserName'@'localhost' IDENTIFIED BY 'pwd';
CREATE USER 'rails_UserNamer'@'%' IDENTIFIED BY 'pwd';
- Grant access rights to any specific user by typing:
GRANT ALL ON rails_myapp.* TO 'rails_UserName'@'localhost';
GRANT ALL ON rails_myapp.* TO 'rails_UserNamer'@'%';
Revoke the privileges.
FLUSH PRIVILEGES;
Exit from the database.
Exit
- To enable remote connections, open the MySQL configuration
my.cnf
and edit using the vim
text editor.
sudo vim /etc/my.cnf
Add the following lines in this file :
[mysqld]
..
.
bind-address = <IP_ADDRESS>
- Save and exit the file by pressing the Esc key and typing :wq, followed by the Enter key.
Create a Rails application
- Install gem for Mysql and update gem.
gem install mysql2
gem update -system
- Install Rails package with the following command:
gem install rails
- Create a Rails application and use the
-d mysql
option to set MySQL as the database.
rails new Your_application -d mysql
- Go to the application directory.
cd Your_application
- Go to
config
directory and open database.yml
file.
cd config/
sudo vim database.yml
- Locate the production section and replace it with the following code:
production:
adapter: mysql
encoding: utf8
database: rails_Database_name
username:Your_application
password: pwd
host: <IP_ADDRESS>
port: 3306
pool: 10
- Save and exit the file by pressing the Esc key and typing :wq, followed by the Enter key.
Install MySQL dependencies
- Open the
Gemfile
.
sudo vim Gemfile
Add the following line :
gem 'mysql'
- Save and exit the file by pressing the Esc key and typing :wq, followed by the Enter key.
- Install all the dependenices of
Gemfile
by using the following command:
bundle install
Conclusion
In this article, you learned to scale Ruby on Rails application and set up a dedicated MySQL Server on CentOS or Fedora.


Beep Boop
A "Beep Boop" Webpage
Please enter some information about yourself
What is your name?
What is your favorite integer?
Results
Input
Input List
Output


I'm trying to pass the pointer of a dynamic array into a template function, but it keeps telling me there is no matching function to call because the parameters I'm passing in are wrong. I can't figure out how to make the function accept the pointer.
Your functions take arrays of pointers to (arrays of) T, while you are simply passing them pointers to (arrays of) T. In other words, the type of list, for example, is int*. You try to pass this to a function expecting a T*[]; there is no way to substitute a type into T to make them match. Perhaps you meant simply T list[], etc. in your functions? Additional, checkNum() doesn't need to be a template function as it doesn't use the template parameter at all.
In regular functions I've always put the pointer in the prototype and function parameters and it worked fine. I don't understand why templates won't accept the pointer.


"What lies behind us and what lies ahead of us are tiny matters compared to what lives within us." -Henry David Thoreau
Expert in navigating high stakes, fast-paced, ever evolving environments!
Innovative and eager to learn, trail blazing is second nature.
"Make it PINK!" -Flora (pink fairy in Sleeping Beauty)


array array_intersect ( array $array1 , array $array2 [, array $ ... ] )
array_intersect() returns an array containing all the values of array1 that are present in all the arguments. Note that keys are preserved.
Returns an array containing all of the values in array1 whose values exist in all of the parameters.


CURRENT HAPPENINGS
CLUBS
DESCRIPTION
VENUE
TIME
DATE
'; $fp = fopen("$xyz.txt",'r'); if (!$fp) {echo 'ERROR: Unable to open file.


ggplotify: Convert Plot to 'grob' or 'ggplot' Object
Convert plot function call (using expression or formula) to 'grob' or 'ggplot' object that compatible to the 'grid' and 'ggplot2' ecosystem. With this package, we are able to e.g. using 'cowplot' to align plots produced by 'base' graphics, 'grid', 'lattice', 'vcd' etc. by converting them to 'ggplot' objects.
| Version: |
0.0.3 |
| Depends: |
R (≥ 3.4.0) |
| Imports: |
ggplot2, graphics, grDevices, grid, gridGraphics, rvcheck |
| Suggests: |
colorspace, cowplot, ggimage, knitr, lattice, prettydoc, vcd |
| Published: |
2018-08-03 |
| Author: |
Guangchuang Yu [aut, cre] |
| Maintainer: |
Guangchuang Yu <guangchuangyu at gmail.com> |
| BugReports: |
https://github.com/GuangchuangYu/ggplotify/issues |
| License: |
Artistic-2.0 |
| URL: |
https://github.com/GuangchuangYu/ggplotify |
| NeedsCompilation: |
no |
| Materials: |
NEWS |
| CRAN checks: |
ggplotify results |
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=ggplotify
to link to this page.


WAG THE DOG A film review by David N. Butterworth Copyright 1997 David N. Butterworth
*** (out of ****)
Don't get me wrong.
"Wag the Dog" isn't a bad film by any means. In fact, it's thoroughly enjoyable. But its comedy is better described as frothy and lightweight than biting and satirical.
Some clues become evident early on. The tag line uses a structure that has been done to death: "A comedy about truth, justice, and other special effects." The pre-credits explanation of the title phrase is simply unnecessary. And almost everything else feels familiar, as if begged, borrowed, or stolen from other films.
Funny? Very. Original? Nah.
Robert De Niro plays Conrad Brean, a "Mr. Fix-It" recruited by government officials to help the President out of a tight spot. Eleven days before the election our nation's leader has been caught with his hands in the cookie jar--a sex scandal with an underage girl scout. Conrad needs a distraction before the story breaks. Something big. How about...a war? With, er...Albania? Not a real war, of course. "A pageant."
Conrad trots off to seek the assistance of Stanley Motss (Dustin Hoffman), a Hollywood producer whose home is bigger than the White House. Stanley, who's never won an award of any kind (since no one understands producers), sees this fabricated conflict as his big opportunity, his "Doctor Zhivago," if you will. Much humor is derived from the fact that Stanley is always intoning "this is *nothing*!" when things start getting out of hand. "Try a ten o'clock pitch meeting coked to the gills and you haven't even read the treatment! *That's* hard."
With "Wag the Dog," Hoffman continues to prove he's one of the most versatile actors around. De Niro, no slouch either, has a more subdued role in the picture; the two of them play off each other like Bert and Ernie.
Anne Heche, perhaps better known for her off-screen role than her on-screen characterizations, is efficient and spunky as White House aide Winifred Ames. Willie Nelson has a small but cute bit as--what else--a country/western songwriter churning out patriotic pop. In fact, with the exception of Woody Harrelson, whose loonie-with-bad-teeth-in-a-wool-cap character is starting to get real old real fast, the cast is nicely balanced.
Director Barry Levinson reportedly pulled all this together in a scant four weeks. With that in mind, the film is remarkably well crafted--breezy camerawork, careful staging, lots of zingy, David Mamet-penned dialogue, and twangy, toe-tapping music by Dire Straits-man Mark Knopfler.
The idea of marketing a war out of political need was more broadly realized in "Canadian Bacon," an under-appreciated 1994 comedy that starred the late great John Candy. As for a scathing satire of the news media, Paddy Chayefsky's brilliant "Network" has yet to find an equal. For a biting satirical comedy, see "The Player." Or "Broadcast News." Or "The Great McGinty." The list goes on.
While "Wag the Dog" doesn't have as much bite as any of those films, it's still an entertaining movie-going experience.
-- David N. Butterworth<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Some selected previews of the examples (shown in detail further down in this document):
0 % 5 % 25 %
80 % 100 % 42 % 42 % 42 % 42 % 42 % 42 % 42 %
To use these content plug-ins, in addition to jQuery and jquery-progresspiesvg-min.js
also include the additional plug-in file jquery-progresspiesvg-controlIcons-min.js
into
your HTML!
$(".pr.icon").each(function(){
var me = $(this);
me.progressPie({
color: "#00d",
strokeWidth: 1,
ringWidth: 3,
contentPlugin: me.hasClass("play") ? "play" : me.hasClass("pause") ? "pause" : "stop"
});
});
applied to elements like:
100 %
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
Normally the icon is drawn in the same color as the outer ring and is auto-sized to fit into the ring.
If you want to get a smaller icon (especially when drawing greater pie/ring charts), you may add
a maxSize
option to the content plug-in options. If you want to override the color, add a color
option. All these content plug-in options are members of an object passed to the progressPie plug-in in option
contentPluginOptions
:
$(".pr.silverback").progressPie({
size: 30,
strokeWidth: 15,
ringWidth: 2,
strokeColor: "#ddd",
color: "#d00",
valueData: "val",
contentPlugin: "pause",
contentPluginOptions: {
color: "navy",
maxSize: 7
}
});
The content plug-ins are primarily designed to put content into the blank space of a ring graph like in the examples above. But in principle it's also possible to combine it with a progress pie graph. In the latter case keep in mind, the content is drawn as a layer on top of the pie graph. If you keep the default color (which is exactly the same as that of the pie), part of the icon will be effectively invisible. So this combination requires you to manually set a color scheme where the content color (here: the control icon) is drawn in a (foreground) color which is well readable on top of the background color (e.g. white) as well as on top of the pie color (e.g. a light grey):
$(".pp.icon").progressPie({
color: "#ccc",
valueData: "val",
contentPlugin: "pause",
contentPluginOptions: {color: "navy"}
});
Comparing this to the first example, you might have noticed that in this case the control icons are larger: The default icon size when combined with a ring graph is calculated based on the inner radius of the always free space inside a filled ring. The default icon size when drawn on top of a pie, on the other hand, is based on the (larger) radius of the surrounding circle stroke of the pie graph.
As already explained and demonstrated above, you may add a color
option to the contentPluginOptions
,
and if you don't, the icon inherits the color
of the chart's foreground.
But there's one exception: In CSS mode the chart's color is not set by
a JavaScript option at all, but left undefined to be styled by a CSS style sheet.
In this case, this content plug-in (as long as you don't specify a color
in the contentPluginOption
)
will also not add local styles to the SVG itself, but leave the styling of the icon to your CSS, too.
For this purpose, the icon shapes are fitted with a CSS class for easy selection in your CSS stylesheet.
The default class name is progresspie-control-icon
.
For example, consider the following script code (as a variation of the first example) defining the global CSS mode
and omitting a color
option:
$(".pr.icon-css").each(function() {
var me = $(this);
me.progressPie({
mode: $.fn.progressPie.Mode.CSS,
size: 30,
strokeWidth: 1,
ringWidth: 3,
valueData: "val",
contentPlugin: me.hasClass("play") ? "play" : me.hasClass("pause") ? "pause" : "stop"
});
});
Now, let's style the chart itself as well as the content plug-in's control icons via CSS rules:
.pr.icon-css .progresspie-background {
stroke: rgba(200, 50, 0, 0.8);
fill: none;
}
.pr.icon-css .progresspie-foreground {
stroke: rgba(200, 50, 0, 0.8);
}
.pr.icon-css.solid .progresspie-control-icon {
fill: rgba(200, 50, 0, 0.8);
}
.pr.icon-css.outline .progresspie-control-icon {
stroke: navy;
stroke-width: 1px;
fill: none;
}
The CSS above contains two different styling exampled, the first of which (class "solid")
simply sets the color by the fill
property:

The second variation (class "outline") adds a stroke and removes the fill:

If you don't want to use the default class name progresspie-control-icon
, you
may define your favorite class name via the content plug-in's cssClass
option:
$(".pr.icon-css2").progressPie({
mode: $.fn.progressPie.Mode.CSS,
cssClassBackgroundCircle: "piebg",
cssClassForegroundPie: "piefg",
size: 30,
strokeWidth: 1,
ringWidth: 3,
valueData: "val",
contentPlugin: "pause",
contentPluginOptions: {
cssClass: "ctrlico"
}
});
.pr.icon-css2 .piebg {
stroke: silver;
fill: none;
}
.pr.icon-css2 .piefg {
stroke: navy;
}
.pr.icon-css2 .ctrlico {
fill: maroon;
}

This plug-in draws a check mark into a closed ring or onto a full pie, i.e. when the percent value equals 100%. Inside a ring, the default color of the check mark equals the color of the ring, while check marks drawn on top of a full pie are drawn in white by default. You may style the check by choosing your own color, changing the default stroke width (of 2px) or changing the line caps (i.e. from round to rectangular):
$(".pp.check1").setupProgressPie({contentPlugin:"checkComplete"}).progressPie();
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
$(".pp.check2").setupProgressPie({
contentPlugin: "checkComplete",
contentPluginOptions: {
strokeWidth: 1
},
color: function(percent) {
return percent === 100 ? $.fn.progressPie.colorByPercent(100) : $.fn.progressPie.Mode.GREY.color;
}
}).progressPie();
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
$(".pr.check1").setupProgressPie({
strokeWidth: 1,
ringWidth: 3,
mode: $.fn.progressPie.Mode.COLOR,
contentPlugin:"checkComplete"
}).progressPie();
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
$(".pr.check2").setupProgressPie({
sizeFactor: 1.5,
strokeWidth: 1,
ringWidth: 3,
color: "navy",
verticalAlign: "middle",
contentPlugin:"checkComplete",
contentPluginOptions: {
strokeWidth: 4,
lineCap: "square",
color: "#0b0"
}
}).progressPie();
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
New: You may optionally set a background color:
$(".pr.check3").progressPie({
sizeFactor: 1.5,
strokeWidth: 1,
ringWidth: 3,
color: "navy",
verticalAlign: "middle",
contentPlugin:"checkComplete",
contentPluginOptions: {
backgroundColor: "#0a0",
color: "white"
}
});
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
The backgroundColor
option (note: contentPluginOptions.backgroundColor
is not to
be confused with the “root” backgroundColor
option, which defines a fill color for the
whole pie or ring chart's background circle!)
may be combined with fullSize
in order to cover
the whole ring…
$(".pr.check4").progressPie({
sizeFactor: 1.5,
strokeWidth: 1,
ringWidth: 3,
color: "navy",
verticalAlign: "middle",
contentPlugin:"checkComplete",
contentPluginOptions: {
backgroundColor: "#0a0",
color: "white",
fullSize: true
}
});
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
… optionally combined with the inBackground
option, which draws the whole check icon
in the background of the ring instead of on top…
$(".pr.check4bg").progressPie({
sizeFactor: 1.5,
strokeWidth: 1,
ringWidth: 3,
color: "navy",
verticalAlign: "middle",
contentPlugin:"checkComplete",
contentPluginOptions: {
backgroundColor: "#0a0",
color: "white",
fullSize: true,
inBackground: true
}
});
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
…or you may set the margin
option in order to vary the
free space between the filled background of the check icon and the
(closed) ring. The iconSizeFactor
option may be added to override the ratio
between the background circle's and the check icon's size, i.e. you may draw larger or smaller
checks if you prefer to.
Note: Both options (margin
and iconSizeFactor
)
are explained in more detail below with the error icon plug-in, see especially:
Details on sizing and measurements.
$(".pr.check5").progressPie({
sizeFactor: 1.5,
strokeWidth: 1,
ringWidth: 3,
color: "navy",
verticalAlign: "middle",
contentPlugin:"checkComplete",
contentPluginOptions: {
backgroundColor: "#0a0",
color: "white",
margin: 2,
iconSizeFactor: 0.8
}
});
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
$(".pp.checkanim").progressPie({
contentPlugin: "checkComplete",
contentPluginOptions: { animate: true }
});
$(".pr.checkanim").progressPie({
strokeWidth: 1,
ringWidth: 3,
scale: 2,
mode: $.fn.progressPie.Mode.COLOR,
contentPlugin:"checkComplete",
contentPluginOptions: {animate: "2s"}
});
$(".pp.checkanimSlow").progressPie({
scale: 2,
contentPlugin: "checkComplete",
contentPluginOptions: {animate: "5s"}
});
Default: 100 %, 2s: 100 %, 5s: 100 %,
Reload page to replay animations
Since the checkComplete plug-in only adds content if the value is 100%, it allows you to specify a secondary
content plug-in which gets called if the value is less than 100%. For this purpose, just add a contentPlugin
option to the contentPluginOptions
of the checkComplete plug-in. Optionally, you may also add a
contentPluginOpions
object to override options set in the "parent" contentPluginOptions
:
The secondary plug-ins gets all the options that were passed to the primary checkComplete plug-in, merged with
this inner options object. In the following example this is demonstrated by the color property: The outer
contentPluginOpion
override the "navy" color set for the ring graph, setting the color for the check to "green".
The inner content plug-in ("pause") would normally inherit its parent's color ("green"), which is overriden in its
own local options to be "maroon" instead.
$(".pr.pauseCheck").progressPie({
sizeFactor: 1.5,
strokeWidth: 1,
ringWidth: 3,
color: "navy",
contentPlugin: "checkComplete",
contentPluginOptions: {
animate: true,
strokeWidth: 3,
color: "green",
contentPlugin: "pause",
contentPluginOptions: { color: "maroon" }
}
});
0 % 5 % 25 % 42 % 50 % 65 % 80 % 99 % 100 %
Like the control-icons plug-in introduced above, this checkComplete plug-in also now supports CSS mode:
mode
option is not set to $.fn.progressPie.Mode.CSS
,
i.e. CSS mode is disabled, the color of the check mark is as demonstrated above:
It defaults to white, but can be explicitly set by adding a color
option to
the contentPluginOptions
. Also, as already shown above, a backgroundColor
may be added to introduce a filled background circle.stroke
property in a CSS stylesheet and don't have
to add an !important
directive.stroke
style in your CSS.fill
style is not supported (it would only fill the triangle you
get if you close the path by directly connecting the end points of the check mark).progresspie-check
, which
you can use in your CSS selectors. You can override this default class name by
specifying a cssClass
option inside the contentPluginOptions
.backgroundColor
option), but want to specify the background color inside your CSS, add the
cssClassBackgroundCircle
option to the contentPluginOptions
instead. This will insert a background circle equipped with the specified class
attribute but without default styles.The following code demonstrates several variations of the aforementioned options:
A pie in CSS mode relying on the default check color (white), a second one overriding the
default by setting a stroke color in the CSS. Then three ring charts, one with and one
without background circle, and a third one which only differs from the second one by setting
the fullSize
option. The last two also use a custom CSS class name for the check mark
while the others rely on the default class name (progresspie-check
).
$(".pp.checkCss").progressPie({
scale: 2,
mode: $.fn.progressPie.Mode.CSS,
valueData: "val",
contentPlugin: "checkComplete"
});
$(".pr.checkCss.noBg").progressPie({
scale: 2,
strokeWidth: 3,
ringWidth: 3,
mode: $.fn.progressPie.Mode.CSS,
valueData: "val",
contentPlugin: "checkComplete"
});
$(".pr.checkCss.bg").progressPie({
scale: 2,
strokeWidth: 3,
ringWidth: 3,
mode: $.fn.progressPie.Mode.CSS,
valueData: "val",
contentPlugin: "checkComplete",
contentPluginOptions: {
cssClass: "tick",
cssClassBackgroundCircle: "tickbg"
}
});
$(".pr.checkCss.fs").progressPie({
scale: 2,
strokeWidth: 3,
ringWidth: 3,
mode: $.fn.progressPie.Mode.CSS,
valueData: "val",
contentPlugin: "checkComplete",
contentPluginOptions: {
cssClass: "tick",
cssClassBackgroundCircle: "tickbg",
fullSize: true
}
});
.pp.checkCss .progresspie-background {
fill: none;
}
.pp.checkCss .progresspie-foreground {
stroke: #aaa;
}
.pp.checkCss.styled .progresspie-check {
stroke: #0e0;
}
.pr.checkCss .progresspie-background {
fill: none;
stroke: silver;
}
.pr.checkCss .progresspie-foreground {
stroke: #888;
}
.pr.checkCss .progresspie-check {
stroke: green;
}
.pr.checkCss .tick {
stroke: white;
}
.pr.checkCss .tickbg {
fill: green;
}

As companions to the checkComplete plug-in, these content plug-ins provide similar icons to depict the fact that the process, whose progress had been monitored by a pie or ring chart, has aborted with an error or warning.
In difference to the check icon, which can be configured in advance of a progress measurement to be shown as soon as the progress reaches 100%, warning or error icons are only designed to be applied retrospectively, usually just in exceptional cases.
I.e. the typical usage scenario would be something like the following:
jquery-progresspiesvg-errorIcons-min.js
into your web page in order to be able to use these plug-ins.setupProgressPie()
function, probably also using the checkComplete plug-in in order to automatically show the check icon if the monitored process terminates regularly.progressPie()
function without parameters, you may draw and update the chart. (To update, you would usually first update the percent value source, then call the progressPie()
jQuery plug-in to redraw, see other examples for details.)setupProgressPie({…})
jQuery plug-in function. The object only needs to define the properties which should be changed/redefined. Any properties which should be left unchanged do not have to be passed to the setup again.contentPlugin
option, setting it to "cross"
, "exclamationMark"
or "warning"
in order to use one of these plug-ins.contentPluginOptions
option to customize the looks of the error or warning icon.progressPie()
again to update the graph.The jquery-progresspiesvg-errorIcons-min.js
currently provides three content plug-ins: cross
draws an X icon (typically used to depict an error message), exclamationMark
draws a simple exclamation mark into or onto the circular icon, and warning
draws a warning sign consisting of an exclamation mark on a filled triangle.
All three of these content plug-ins will now be demonstrated in combination with previous examples of the checkComplete
plug-in. So refer to the examples above to find the initial setup for the classes pp check1
, pr check1
and pr check2
. These examples only modify the initial setups.
Combining the cross
and exclamationMark
plug-ins with the previous simple pie example (class .pp.check1
):
$(".pp.cross1").setupProgressPie({
contentPlugin: "cross"
}).progressPie();
$(".pp.excla1").setupProgressPie({
contentPlugin: "exclamationMark"
}).progressPie();
applied to:
0 %
5 %
25 %
42 %
42 %
0 % 5 % 25 % 42 % 42 %
As you see, the default settings fill the whole circle with red resp. yellow background color and draw a white cross resp. exclamation mark on top. You may choose different foreground or background colors, stroke width, line cap etc.
By default, the icon's background totally occludes the pie graph. If you still want the progress to remain visible, you have several alternative options:
rgba
value with alpha channel for the background color in order
to fill the background semi-transparently, so the pie still shines through.margin
property in order to draw a smaller, centered error icon
and leave the outer rim of the pie chart visible.inBackground
option.
In this case, it's recommended to use a semi-transparent foreground color for the pie so that the
error or warning icon remains visible for larger percent values.The following examples demonstrate all four options:
$(".pp.cross2").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
withBackground: false,
iconColor: "red",
strokeWidth: 3,
lineCap: "square"
}
}).progressPie();
$(".pp.cross3").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
backgroundColor: "rgba(255,0,0,0.5)"
}
}).progressPie();
$(".pp.cross4").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
margin: 3,
strokeWidth: 1,
iconSizeFactor: 0.7
}
}).progressPie();
$(".pp.crossbg").setupProgressPie({
color: "rgba(0,0,0,0.4)",
contentPlugin: "cross",
contentPluginOptions: {
inBackground: true
}
}).progressPie();
$(".pp.excla2").setupProgressPie({
contentPlugin: "exclamationMark",
contentPluginOptions: {
strokeWidth: 1
}
}).progressPie();
$(".pp.excla3").setupProgressPie({
contentPlugin: "exclamationMark",
contentPluginOptions: {
backgroundColor: null,
iconColor: "red",
strokeWidth: 3
}
}).progressPie();
$(".pp.excla4").setupProgressPie({
contentPlugin: "exclamationMark",
contentPluginOptions: {
backgroundColor: "rgba(255,230,0,0.6)",
iconColor: "black"
}
}).progressPie();
$(".pp.exclabg").setupProgressPie({
color: "rgba(0,0,0,0.2)",
contentPlugin: "exclamationMark",
contentPluginOptions: {
inBackground: true
}
}).progressPie();
42 % 42 % 42 % 42 % 42 % 42 % 42 % 42 %
If you combine these content plug-ins with a progress ring, by default the icons only fill the white space inside the ring, always leaving the progress ring itself visible:
$(".pr.cross1").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {}
}).progressPie();
$(".pr.cross2").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
backgroundColor: null,
iconColor: "red"
}
}).progressPie();
$(".pr.excla1").setupProgressPie({
contentPlugin: "exclamationMark",
contentPluginOptions: {}
}).progressPie();
$(".pr.excla2").setupProgressPie({
contentPlugin: "exclamationMark",
contentPluginOptions: {
backgroundColor: null,
iconColor: "red"
}
}).progressPie();
applied to:
0 %
5 %
25 %
42 %
42 %
42 %
42 %
0 % 5 % 25 % 42 % 42 % 42 % 42 %
You may optionally choose a full size icon analogous to drawing on top of a pie, optionally
placed in the background so that the ring remains visible on top of the full sized icon (in the latter
case, the examples choose "navy" as foreground color for the ring in order to get a nice contrast).
Also, the following examples demonstrate SMIL animation (reload to trigger, not supported in IE/Edge):
$(".pr.crossFs").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
fullSize: true,
animate: true
}
}).progressPie();
$(".pr.crossFsBg").setupProgressPie({
color: "navy",
contentPlugin: "cross",
contentPluginOptions: {
fullSize: true,
inBackground: true,
animate: true,
iconSizeFactor: 0.5
}
}).progressPie();
$(".pr.exclaFs").setupProgressPie({
contentPlugin: "exclamationMark",
contentPluginOptions: {
fullSize: true,
strokeWidth: 4,
animate: true
}
}).progressPie();
$(".pr.exclaFs2").setupProgressPie({
contentPlugin: "exclamationMark",
contentPluginOptions: {
fullSize: true,
backgroundColor: "#700",
lineCap: "square",
strokeWidth: 3,
animate: "2s"
}
}).progressPie();
$(".pr.exclaFsBg").setupProgressPie({
color: "navy",
contentPlugin: "exclamationMark",
contentPluginOptions: {
fullSize: true,
inBackground: true,
animate: true,
iconSizeFactor: 0.5
}
}).progressPie();
42 % 42 % 42 % 42 % 42 %
Notice that the exclamation mark gets reduced to a simple vertical line if the line width is too large to draw a well proportioned exclamation mark considering the available height.
With the default setting fullSize === false
, and when combined with a progress ring
instead of a pie, the error or warning icon gets placed inside the ring, leaving by default a 1px gap between the
ring and the content. You may also override this default by setting the margin
option:
$(".pr.crossMargin0").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
margin: 0
}
}).progressPie();
$(".pr.crossMargin3").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
margin: 3,
strokeWidth: 1
}
}).progressPie();
42 % 42 %
Finally, to demo the icons in larger size, let's repeat all of the examples above, combining the them with the base ring example class .pr.check2
instead of .pr.check1
(both taken from the examples for the checkComplete
plug-in):
0 % 5 % 25 % 42 % 42 % 42 % 42 % 42 % 42 % 42 % 42 % 42 % 42 % 42 %
Finally, let's talk about circle sizes / radii: The whole pie graph or ring graph is circular and has
a total outer radius (obviously). It has already been demonstrated that in pie mode the error / warning icons
will use this total radius (optionally minus a margin
, defaulting to 0),
while in ring mode, they get scaled into a smaller circle fitting inside
the ring (unless the fullSize
option is set).
In the latter case (ring mode, !fullSize
), the error icon's radius is the total radius minus the ringWidth
minus an optional margin
(defaulting to 1). Let's call this radius r
.
The image above shows the ringWidth
(property of the progress pie plug-in options), the margin
(property of the content plug-in options) and the remaining content radius r
as well as the total radius
and two other derived values. (Derived values are set in italic.)
 The actual icon which gets drawn on top of that filled circle
(cross or exclamation mark), is usually even smaller than the filled background, leaving an
inner padding between the line ends and the outer edge of the filled background.
I.e. the actual icon gets fitted into an even smaller circle inside the background's circle.
The radius of this icon's circumcircle (see dashed silver circle in the image above) is r * iconSizeFactor
,
iconSizeFactor
being a option, which is set to 0.6
by default, but may be customized via contentPluginOptions
. The padding is the difference between r
and the actual icon's radius.
Note that the padding—other than the margin—is not set as an absolute value, but is indirectly defined via the iconSizeFactor
relative to the icon size: With an iconSizeFactor
of 0.6, the padding is 40% of r
.
The greater the factor, the smaller the padding. Setting iconSizeFactor
to 1.0 will remove the padding
completely, resulting in the icon “touching” the background's border:
If you set backgroundColor
to null
, the margin
property
will be ignored! Then the icon will be drawn directly into a transparent circle with either total radius (pie or fullSize
)
or into the ring, with the padding (derived from the iconSizeFactor
) as the total distance between
the icon's circumcircle and the ring resp. the total radius.
In the following example we'll add an error (cross) icon to a much larger graphic (taken from the Value display plug-in examples which will be shown later on this page). Let's assume we want a smaller cross an that large red disc, so we set the icon size (and thus the padding) to 50%. Also, we'll increase the margin to 3, leaving a 3 pixel gap between the ring and the error icon's background:
$(".percent.smallerCross").setupProgressPie({
contentPlugin: "cross",
contentPluginOptions: {
iconSizeFactor: 0.5,
strokeWidth: 4,
margin: 3
}
}).progressPie();
applied to

Very similar to the checkComplete
plug-in, these warning and error icon plug-ins also
now support CSS mode:
mode
option is not set to $.fn.progressPie.Mode.CSS
,
i.e. CSS mode is disabled, the icon color and optional filled background's color are
controlled as shown above. They are inserted into the chart as inline styles which
could only be overridden by external style sheets using the !important
directive.!important
directive (as in Non-CSS-Mode).class
attributes are added to the icon and, if present, the background circle (which
can be completely omitted by setting withBackground
to false).
This enables easy selection of the icons by external style sheets.progresspie-erroricon
resp. progresspie-erroricon-background
(defined in $.fn.progressPie.contentPlugin.errorIconsCommonDefaults
)
and can be overridden by adding the options cssClass
resp. cssClassBackgroundCircle
to the contentPluginOptions
.
Examples:
$(".pp.crossCss").setupProgressPie({
mode: $.fn.progressPie.Mode.CSS,
valueData: "val",
contentPlugin: "cross",
contentPluginOptions: {
strokeWidth: 3,
iconSizeFactor: 0.7
}
}).progressPie();
$(".pr.crossCss.bg").setupProgressPie({
mode: $.fn.progressPie.Mode.CSS,
strokeWidth: 1,
ringWidth: 3,
valueData: "val",
contentPlugin: "cross",
contentPluginOptions: {
margin: 1,
iconSizeFactor: 0.8,
cssClass: "crossFg",
cssClassBackgroundCircle: "crossBg"
}
}).progressPie();
$(".pr.crossCss.noBg").setupProgressPie({
mode: $.fn.progressPie.Mode.CSS,
strokeWidth: 1,
ringWidth: 3,
valueData: "val",
contentPlugin: "cross",
contentPluginOptions: {
iconSizeFactor: 0.8,
withBackground: false
}
}).progressPie();
$(".pr.exclaCSS").setupProgressPie({
mode: $.fn.progressPie.Mode.CSS,
strokeWidth: 2,
ringWidth: 2,
valueData: "val",
contentPlugin: "exclamationMark",
contentPluginOptions: {
fullSize: true,
animate: true
}
}).progressPie();
.pp.crossCss .progresspie-background {
fill: none;
}
.pp.crossCss .progresspie-foreground {
stroke: #aaa;
}
.pp.crossCss .progresspie-erroricon-background {
opacity: 0.7;
}
.pr.crossCss .progresspie-background {
fill: none;
stroke: navy;
}
.pr.crossCss .progresspie-background {
fill: none;
stroke: navy;
}
.pr.crossCss .progresspie-foreground {
stroke: navy;
}
.pr.crossCss .crossFg {
stroke: red;
}
.pr.crossCss .crossBg {
fill: silver;
stroke: none;
}
.pr.crossCss.noBg .progresspie-erroricon {
stroke-linecap: square;
stroke-width: 3;
stroke: rgb(150, 0, 0);
}
.pr.exclaCSS .progresspie-background {
fill: #ddd;
stroke: #ccc;
}
.pr.exclaCSS .progresspie-foreground {
stroke: navy;
}
.pr.exclaCSS .progresspie-erroricon-background {
fill: rgba(255, 255, 0, 0.6);
}
.pr.exclaCSS .progresspie-erroricon {
stroke: #a00;
fill: #a00;
}

The first example demonstrates what happens, if you omit color styles in CSS mode: The default colors (white cross on red background) still apply. It also demonstrates (by reducing the opacity of the background circle via CSS) that the half-filled pie chart behind the error icon is always present in CSS mode, since the script code can't decide, whether it will be fully occluded by the content plug-in or not. In Non-CSS-mode, on the other hand, no (effectively invisible) pie would be inserted behind a full-sized content plug-in with solidly filled background at all.
The second example demonstrates a combination with a ring chart and setting foreground and background color via CSS rules, while using custom class names defined in the contentPluginOptions.
The third example is similar to the second, but it explicitly removes the background and uses the default CSS class name for the icon itself.
The fourth example demonstrates styling the exclamation mark.
Note that there exist two SVG shapes of class progresspie-erroricon
in
this case: one stroke (the vertical line of the exclamation mark) and one circle (the dot beneath).
The line can not be filled, it can only be styled by the stroke
property.
The circle, on the other hand, is only meant to be filled, so you normally only would
need to style the fill
property. The example sets stroke
and fill
for both shapes. The fill
property for the line does not have any effect.
A stroke around the circle however could increase the dot in size (diameter). In order
to prevent that, the stroke-width
property of the circle defaults to 0.
You could, however set the fill to 0 and explicityl set the stroke-with (to something like 0.5),
in order to only draw the dot's online. But I wouldn't recommend that.
If you prefer a triangular warning sign instead of a simple exclamation mark in a circle,
you may use the content plug-in warning
instead of exclamationMark
.
Similar to the latter, this plug-in draws an exclamation mark in a foreground color (default: white)
on a background (default: yellow), only this time, the background does not fill the whole pie or
the whole inner space of a ring, but is a triangle placed on top of the pie chart or
inside the ring:
$(".pp.warn1").setupProgressPie({
contentPlugin: "warning"
}).progressPie();
$(".pr.warn1").setupProgressPie({
contentPlugin: "warning",
contentPluginOptions: {
strokeWidth: 1
}
}).progressPie();
42 % 42 % 42 %
In addition to the other two plug-in's options like iconColor
, backgroundColor
or
strokeWidth
this plug-in introduces a borderRadius
option: Its default
value is zero, which means the three corners of the triangle are not rounded. By setting it to (small) positive values
you may draw rounded corners. Setting a positive border radius also increases the size of the triangle
to maintain the margin between the ring and the now clipped corners.
$(".pr.warn2").setupProgressPie({
contentPlugin: "warning",
contentPluginOptions: {
borderRadius: 2,
backgroundColor: "red"
}
}).progressPie();
42 % 42 %
All other options of cross
and exclamationMark
are also applicable.
You might, for example, also set the fullSize
option to true. Yet, in this case,
this will of course not cover the whole graph, but simply draw the triangles corners over the ring:
$(".pr.warnFs").setupProgressPie({
contentPlugin: "warning",
contentPluginOptions: {
fullSize: true,
borderRadius:1
}
}).progressPie();
42 % 42 %
Just like with the other plug-ins above you may optionally place the triangle into the background:
$(".pr.warnFsBg").setupProgressPie({
contentPlugin: "warning",
contentPluginOptions: {
fullSize: true,
inBackground: true,
borderRadius:1
}
}).progressPie();
42 % 42 %
In difference to the circular exclamationMark
and cross
icons, this
triangular warning
icon will never actually fully cover/occlude the pie or ring chart.
But in case you just want to replace the progress indicator by the warning sign without the chart
still visible in the background, and you really want to use the triangular warning
sign
and not the circular exclamationMark
, the warning
content plug-in offers you the
additional boolean option hideChart
. Just set it to true
, then the chart
won't be drawn in the background:
$(".pr.warnOnly").setupProgressPie({
contentPlugin: "warning",
contentPluginOptions: {
fullSize: true,
borderRadius: 2,
hideChart: true
}
}).progressPie();
42 % 42 %
Styling in CSS mode is mainly the same as with the other errorIcons (cross and exclamationMark). One example:
$(".pr.warnOnlyCss").setupProgressPie({
size: 30,
contentPlugin: "warning",
mode: $.fn.progressPie.Mode.CSS,
contentPluginOptions: {
fullSize: true,
borderRadius: 2,
hideChart: true
}
}).progressPie();
.pr.warnOnlyCss svg {
vertical-align: middle;
}
.pr.warnOnlyCss .progresspie-erroricon-background {
stroke: #ddd;
fill: #ddd;
}
.pr.warnOnlyCss .progresspie-erroricon {
stroke: red;
fill: red;
}
42 %
Imagine you let your users start a process without progress measurement. So you just want to show some rotating “busy indicator”, but when the process terminates, this should change to an icon showing the final state, either success, error or warning.
The following example shows a proposal how to realize that with the progressPie plug-in. Some features I want to point out:
RUNNING
, SUCCESS
, ERROR
and WARNING
.
The options valueAdapter
and valueByRawValue
are then used to convert these string
values to a percent value and options. The calculated percent value for RUNNING
defines the size of
the gap in the rotating ring, the 100 percent value for SUCCESS
ensures that the content plug-in
checkComplete
shows the check icon, for the other states, the percent value does not matter.var busyExampleCommonContentPluginOptions = {
fullSize: true,
animate: true
}
$("#busyExample").css("opacity", 0).setupProgressPie({
valueData: "state",
ringWidth: 2,
strokeWidth: 0,
verticalAlign: "middle",
valueAdapter: function(state) {
return state === 'RUNNING' ? 80 : 100;
},
optionsByRawValue: function(state) {
switch (state) {
case 'RUNNING': return {
rotation: true
};
case 'SUCCESS': return {
contentPlugin: "checkComplete",
contentPluginOptions: $.extend({}, busyExampleCommonContentPluginOptions, {
color: "white",
backgroundColor: "#0a0"
})
};
case 'ERROR': return {
contentPlugin: "cross",
contentPluginOptions: busyExampleCommonContentPluginOptions
};
case 'WARNING': return {
contentPlugin: "warning",
contentPluginOptions: $.extend({}, busyExampleCommonContentPluginOptions, {
hideChart: true,
borderRadius: 3
})
};
}
}
});
$(".btnBusyExample").click(function() {
$(".btnBusyExample").prop("disabled", true);
$("#busyExample").data("state", "RUNNING").css("opacity", 1).progressPie();
var finalState = $(this).data("finalState");
setTimeout(function() {
$("#busyExample").data("state", finalState).progressPie();
setTimeout(function() {
$("#busyExample").css("opacity", 0);
$(".btnBusyExample").prop("disabled", false);
}, 5000);
}, 3000);
});
#busyExample {
transition: opacity 2s;
}

<button class="btnBusyExample" data-final-state="SUCCESS">trigger demo -> success</button>
<button class="btnBusyExample" data-final-state="ERROR">trigger demo -> error</button>
<button class="btnBusyExample" data-final-state="WARNING">trigger demo -> warning</button>

To use these content plug-ins, in addition to jQuer and jquery-progresspiesvg-min.js
also include the additional plug-in file jquery-progresspiesvg-valueDisplay-min.js
into
your HTML!
$(".percent.default:not(.singleLine)").setupProgressPie({
verticalAlign: "middle",
valueData: "val",
size: 50,
ringWidth: 3,
strokeWidth: 3,
strokeColor: "#ddd",
color: "navy",
contentPlugin: "percent"
}).progressPie();
Default font: Helvetica:
The font face is not configured as part of the SVG, but of the conainting HTML element, and is inherited by the SVG.
size: 30
):Default font: Helvetica:
$(".percent.rounded").progressPie({
verticalAlign: "middle",
valueData: "val",
size: 50,
ringWidth: 7,
ringEndsRounded: true,
strokeWidth: 7,
strokeColor: "#eee",
color: "#a00",
contentPlugin: "percent",
contentPluginOptions: {
color: "navy"
}
});
Default font: Helvetica:
This also demonstrates the fact that the font-size is calculated based on the inner radius of the ring graph: A thicker ring with unchanged outer radius / overall size means less space inside the ring and a smaller font for the value.
$(".percent.singleLine.default").progressPie({
verticalAlign: "middle",
valueData: "val",
size: 50,
ringWidth: 3,
strokeWidth: 3,
strokeColor: "#ddd",
color: "navy",
contentPlugin: "percent",
contentPluginOptions: {
singleLine: true
}
});
Default font: Helvetica:
$(".percent.singleLine.resized").progressPie({
verticalAlign: "middle",
valueData: "val",
size: 50,
ringWidth: 3,
strokeWidth: 3,
strokeColor: "#ddd",
color: "navy",
contentPlugin: "percent",
contentPluginOptions: {
singleLine: true,
fontSizeFactor: 0.8,
unitFontSizeFactor: 0.5
}
});
Default font: Helvetica:
If you supply other values than plain percent numbers (1..100) and provided a value adapter function to convert your raw values to percent, this value display plug-in may also display the original (raw) value instead of the percent value calculated by the value adapter.
In these examples the raw value is a seconds value in (1..60). The first exampled sets a unit label to "sec.", the second example leaves the unit label unset and simply displays the number. Both increase the font size, since two-digit numbers need less width than the max. three-digit percent numbers.
$(".secs.withUnit").progressPie({
valueData: "val",
valueAdapter: function(s) {return parseInt(s) * 10 / 6;},
size: 50,
ringWidth: 5,
strokeWidth: 5,
strokeColor: "#ddd",
strokeDashes: {
count: 12,
length: 2,
centered: true,
inverted: true
},
mode: $.fn.progressPie.Mode.COLOR,
contentPlugin: "rawValue",
contentPluginOptions: {
unit: "sec.",
fontSizeFactor: 1.2
}
});
Default font: Helvetica:
$(".secs.noUnit").progressPie({
valueData: "val",
valueAdapter: function(s) {return parseInt(s) * 10 / 6;},
size: 50,
ringWidth: 5,
strokeWidth: 5,
strokeColor: "#ddd",
strokeDashes: {
count: 12,
length: 2,
centered: true
},
mode: $.fn.progressPie.Mode.COLOR,
contentPlugin: "rawValue",
contentPluginOptions: {
fontSizeFactor: 1.4
}
});
Default font: Helvetica:
Just like the content plug-ins introduces before, this "valueDisplay" plug-in now also supports CSS mode:
class
attributes),
and that's always the case, independently of CSS mode:
text
element.progresspie-valuedisplay
.cssClass
to contentPluginOptions
in order
to override this default and specify a custom class name.tspan
) of that text element.
It is qualified with a CSS class name of its own, defaulting to progresspie-unit
.cssClassUnit
to the contentPluginOptions
n order
to override this default and specify a custom class name..progresspie-valuedisplay
by default also apply
to the unit label, the class .progresspie-unit
is only meant for the case
that the unit label's styles should differ from the value display's styles.fill
style is used to specify the font color. In CSS mode, that style is omitted,
resulting in a black color, as long as no CSS style sheets define a different color.The next two examples demonstrate the use of CSS mode. The first one does not specify any
contentPluginOption
at all, the second one demonstrates custom CSS class names.
While the second example only uses CSS for defining colors – different colors for value and unit
in this case –, the first one also shows how other aspects like font-family and font-weight
can be styled.
$(".percent.css.style1").progressPie({
mode: $.fn.progressPie.Mode.CSS,
valueData: "val",
size: 50,
ringWidth: 3,
strokeWidth: 3,
contentPlugin: "percent"
});
$(".percent.css.style2").progressPie({
mode: $.fn.progressPie.Mode.CSS,
valueData: "val",
size: 50,
ringWidth: 3,
strokeWidth: 3,
contentPlugin: "percent",
contentPluginOptions: {
singleLine: true,
cssClass: "percents",
cssClassUnit: "unitlabel"
}
});
.percent.css svg {
vertical-align: middle;
}
.percent.css .progresspie-background {
stroke: silver;
fill: #eee;
}
.percent.css .progresspie-foreground {
stroke: navy;
}
.percent.css.style1 .progresspie-valuedisplay {
fill: #058;
font-weight: bold;
font-family: sans-serif;
}
.percent.css.style2 .percents {
fill: maroon;
}
.percent.css.style2 .unitlabel {
fill: green;
}

A last example is just to demonstrate that CSS styling is not restricted to CSS mode: The JavaScript code in this example is identical to a previous example. In Particular, the color of the value display is not defined statically via CSS, but dynamically dependent on the pie's value like in the previous example, just the unit label is now statically CSS-colored. In addition, CSS is used to select a font family for the whole text content.
.secs.withUnit.cssOverride .progresspie-valuedisplay {
font-family: sans-serif;
}
.secs.withUnit.cssOverride .progresspie-unit {
fill: navy;
font-weight: bold;
}

To use these content plug-ins, in addition to jQuery and jquery-progresspiesvg-min.js
also include the additional plug-in file jquery-progresspiesvg-image-min.js
into
your HTML!
The image
content plug-in can be used to load an external image file.
(To be precise, an SVG element referencing an external image file by a URL is included which
tells the browser to separately load the image file and render it as part of the SVG image.)
By default, the loaded image is placed in the background, i.e. behind the pie chart.
The following example loads a perfectly circular image as background.
The foreground color of the pie is semi-transparent in order to let part of the background image shine through.
In this case we use the predefined color scheme for a color (red-yellow-green) depending on the percent
value, but since we need transparency, we can't use the predefined COLOR
mode, but we write
our own color function simply calling the predefined static $.fn.progressPie.colorByPercent()
function which
provides an optional second parameter for setting an alpha channel.
Furthermore, the background circle is disabled (stroke width: 0):
$(".pp.world").progressPie({
color: function(percent) {
return $.fn.progressPie.colorByPercent(percent, 0.7);
},
size: 120,
strokeWidth: 0,
valueData: "val",
contentPlugin: "image",
contentPluginOptions: {
href: "img/earth-147591.svg"
}
});
In this case the visible part of the image is exactly the area of the pie chart, as the image is square and the areas of that image outside the maximum fitting circle are transparent. But consider, we'd use a photo without such transparent regions:
$(".pp.worldphoto.rect").progressPie({
color: "rgba(0,150,250,0.6)",
size: 120,
strokeWidth: 0,
valueData: "val",
contentPlugin: "image",
contentPluginOptions: {
href: "img/world-photo.jpg"
}
});
You see the whole image is used as background. This can be changed by setting
the image
content plug-in's option clipCircle
to true
, which
will cut a circle out of the background image.
Also, since the world in this photo is slightly smaller than the pie graph
and the image is not perfectly rectangular, leaving a small unfilled gap
on top and bottom, let's draw a navy-colored background circle around the pie chart.
By setting overlap
to false, the blue semi-transparent pie will not
be overlapping said navy background circle but be drawn inside:
$(".pp.worldphoto.clipped").progressPie({
color: "rgba(0,150,250,0.6)",
size: 120,
strokeWidth: 3,
strokeColor: "navy",
overlap: false,
valueData: "val",
contentPlugin: "image",
contentPluginOptions: {
href: "img/world-photo.jpg",
clipCircle: true
}
});
If you draw a ring graph (by setting the ringWidth
option), by default the
image will be drawn to fit inside the ring:
$(".pr.aroundworld").progressPie({
scale: 2,
color: "navy",
size: 60,
strokeWidth: 0,
ringWidth: 6,
valueData: "val",
contentPlugin: "image",
contentPluginOptions: {
href: "img/earth-147591.svg",
margin: 0
}
});
For the image to be drawn as fullsize background just like in pie mode, set the
fullSize
option (in the contentPluginOptions
) to true.
Just like in pie mode, the image is drawn into the background by default, such that
the ring wil be drawn on top of the image.
The next example also demonstrates the use of more than one content plug-in: Not only will a fullsize image be loaded as background, but the Value Display plug-in (see above) will also be used to display the percent value in the foreground (inside the ring, on top of the background image):
$(".pr.twoplugins").progressPie({
scale: 2,
color: "navy",
size: 60,
valueData: "val",
strokeWidth: 2,
ringWidth: 8,
contentPlugin: ["image", "percent"],
contentPluginOptions: [
{ // options for "image"
href: "img/earth-147591.svg",
fullSize: true
},
{ // options for "percent"
color: "white",
}
]
});
For better readability of the numbers on top of the image, we set the font weight to bold, by setting a style on the paragraph containing the charts:

As has already been said, for a ring graph a loded image will by default be fitted inside the circle. This mode is usually not meant for background images but for content inside the graph similar to the other content plug-ins above, only that the content is loaded from a file.
The following example shows such an image inside a ring graph. The rest of the chart, in this case, is styled via CSS.
$(".pr.car").progressPie({
mode: $.fn.progressPie.Mode.CSS,
size: 120,
valueData: "val",
strokeWidth: 10,
ringWidth: 10,
contentPlugin: "image",
contentPluginOptions: {
href: "img/car-160115.svg",
inBackground: false,
margin: 6
}
});
.pr.car svg {
vertical-align: bottom;
}
.pr.car .progresspie-background {
fill: #eef;
stroke: #dde;
}
.pr.car .progresspie-foreground {
stroke: #55f;
}
Let's assume some content images may not completely fit into the ring.
In this case, it makes a difference whether they are drawn in background (will be overlapped
by the ring, default) or in foreground (will overlap the ring).
The following example demonstrates that, the images (see: eyebrows) slightly overlap the ring.
To achieve this, the inBackground
option is set to false (defaults to true).
Also, this example will load one out of three different images depending on the percent value:
var smileyOptions = {
inBackground: false,
margin: -1
};
$(".pr.smiley").progressPie({
mode: $.fn.progressPie.Mode.COLOR,
size: 120,
valueData: "val",
strokeWidth: 6,
ringWidth: 6,
strokeColor: "#ddd",
contentPlugin: "image",
optionsByPercent: function(percent) {
if (percent < 33) {
return { contentPluginOptions: $.extend({href: "img/frowning-150840.svg"}, smileyOptions)};
} else if (percent &t; 66) {
return { contentPluginOptions: $.extend({href: "img/smiley-150841.svg"}, smileyOptions)};
} else {
return { contentPluginOptions: $.extend({href: "img/smiley-150837.svg"}, smileyOptions)};
}
}
});
Not only can you load an image into the background or foreground of the pie or ring (optionally clipping
it circularly). Alternatively, you may also use the MASK
mode:
Setting mode: $.fn.progressPie.Mode.MASK
is only applicable if at least one
content plug-in is specified which draws into the background of the chart. The chart
will then be used as a mask for the previous layer, i.e. the output of the first content plug-in
which draws into the background. For now let's work with only one content plug-in drawing a background
image.
The default behaviour of the MASK mode is: Every point of the chart itself will be showing the background image, every point not covered by the chart will stay transparent and not show the background image. One could say the background image provides the 'ink' for drawing the chart:
$(".pp.mask").setupProgressPie({
mode: $.fn.progressPie.Mode.MASK,
strokeWidth: 5,
size: 120,
valueData: "val",
contentPlugin: "image",
contentPluginOptions: {
href: "img/earth-147591.svg"
}
}).progressPie();
In case you define more than one background image, only the layer directly behind the pie will be masked by the pie. Layers behind that will be drawn as regular background images. The following example will demonstrate this by adding a second background image behind the world background:
$(".pp.mask2").setupProgressPie({
mode: $.fn.progressPie.Mode.MASK,
strokeWidth: 5,
size: 120,
valueData: "val",
contentPlugin: ["image", "image"],
contentPluginOptions: [
{ //first background, i.e. layer directly behind chart, to be masked
href: "img/earth-147591.svg"
},
{ //second background, i.e. layer even behind first background, not masked
href: "img/puzzlebg.png"
}
]
}).progressPie();
Of course, this puzzle background might also be clipped circulary with the clipCircle
option,
as has already been demonstrated above.
Below in section Margin and Padding we'll pick up on this example again,
showing how to reduce the size of the chart in relation to the background image.
The default mask only consists of opaque and transparent regions. The chart's color
in the mask is set to $.fn.progressPie.Mode.MASK.color
, which defaults to 'white'
:
White parts of the mask are showing 100% of the background image.
The rest of the mask (like the inner of the background circle) is not filled at all by default,
meaning the resulting image also won't be filled there, i.e. none of the background image will show.
The foreground color could be modified globally by overwriting $.fn.progressPie.Mode.MASK.color
or
locally by CSS formatting or via progressPie's standard options color
and strokeColor
.
Only in MASK mode
these colors are not drawn visibly into a diagram layer but into the mask, defining the grade of
transparency. The following example demonstrates this by using a color function defining a color
from black (fully transparent mask) for 0% and white (fully opaque mask) for 100% with linear grades in
between for any ohter percent value:
$(".pp.mask2.fg").setupProgressPie({
color: function(p) {
var v = Math.ceil(p * 255 / 100);
return "rgb(" + v + ", " + v + ", " + v + ")";
}
}).progressPie();
Analogously, you may alter the background color of the mask:
Let's modify both of the .pp.mask
and .pp.mask2
examples
by adding the backgroundColor
option to each, which defines a fill color for the rest of the circle
not covered by the pie (but not for the background outside the circle).
We're setting it to some dark shade of grey. While white areas of the mask show 100% of the background image and black
areas just like transparent areas completely hide the background, colors in between these extremes simply
partially mask the background image: The darker, the less of the image shines through.
$(".pp.mask.bg, .pp.mask2.bg").setupProgressPie({
backgroundColor: "#444"
}).progressPie();
Beside the MASK
mode there's also an inverted mask mode, called IMASK
.
In IMASK
mode, the pie inside the mask is drawn in color $.fn.progressPie.Mode.IMASK.color
(defaulting to black)
and the background of the mask is filled in $.fn.progressPie.Mode.IMASK.color
(defaulting to white).
This means the pie is effectively cut out of the background image, leaving a transparent shape of the pie:
$(".pp.imask").progressPie({
mode: $.fn.progressPie.Mode.IMASK,
strokeWidth: 5,
size: 120,
valueData: "val",
contentPlugin: "image",
contentPluginOptions: {
href: "img/puzzlebg.png"
}
});
The example above is not meant to look pretty, it's just a first simple demonstration of IMASK mode. Further below we'll use IMASK mode in combination with some other features like background rectangles and padding for a more complex and more beautiful example.
The progressPie() method supports two options which both introduce a border around the pie or ring chart:
margin
defines the width of an always transparent outer border around the chart.
Effectively, this just enlarges the so-called view box of the SVG image.padding
defines the width of an inner border (between the outer margin
border and the chart).Both options may be simple numbers (defining a margin or padding of the same width on all four sides of the rectangular SVG image) or they may be arrays of up to 4 numbers, defining different widths for the four sides. If you use an array property, stating up to four numbers for the width of a margin or padding, these are read as follows (analogous to the margin and padding shorthand specifications in CSS): The first number defines the top margin, the second defines the right margin, the third's the bottom margin and the fourth is the left margin. If you think of an analog clock face, the margin/padding values are read clockwise, beginning at the top (12 o'clock). If you don't specify a fourth value (left), the left margin/padding equals the right. If you don't specify a third value, the bottom margin/padding will match the top margin/padding.
Both options default to 0, i.e. by default neither margin nor padding are added around the chart.
Margin and padding add up to the total free border around the chart.
The difference between them only shows when using content plug-ins like "image"
or "backgroundRect"
(see next section): These may draw a background larger than the
pie itself. The boundaries of a background rectangle or a full-sized background image
(i.e. one not fitted into a ring graph) are exactly the chart's size plus its padding
,
i.e. the inner border will also be filled with the background, while the outer border (margin
)
will always stay blank.
The following example demonstrates this: We set a padding
of 20 pixels, meaning that
the background images are 40 pixels wider and higher than the pie's size
.
If you compare this to the examples above, you'll find, that in the latter the chart “touched” the edges
of the background image, while now there's a 20 pixel wide gap in each direction between the pie and
the puzzle image's edges.
For demonstration purposes, we also set a margin
, i.e blank space left free around the
background image. In this case, we'll demonstrate the array syntax for a non-symmetrical margin:
margin: [5, 10, 20]
sets a top margin of 5 pixels, a right margin of 10 pixels and
a bottom margin of 20 pixels. Since no fourth value (left margin) is given, the left margin
equals the right margin (10 pixels).
To visualize the margin, we add a dotted border around the whole SVG image via CSS.
The blank (transparent) space between the dotted
line and the background image is exactly this margin.
Lastly, it's important to know that the padding: 20
setting not only enlarges the
area of the puzzle background image, but also that of the earth background image (masked by the pie).
If we accepted that, only an inner part of that globe icon would be visible through the pie mask:
Notice that, in comparison to images above, Africa as well as northern parts of North America and southern South America
are missing. We clearly don't see the whole globe as shown in previous examples.
In order to compensate this clipping of the globe, i.e. to scale down the earth image again to the size of the pie chart,
we add margin: 20
to the earth image's contentPluginOptions
.
This way, inside the area filled by the content plug-in (pie size plus global padding) a margin of exactly the
same size as the global padding is left free, i.e. the actual image is the same size as the pie chart again,
the pie chart's padding and the content plug-in's own inner margin neutralize each other.
(The content plug-in's margin—see Details on sizing and measurements—is not
to be confused with the global chart's margin!)
The complete examples looks as follows:
$(".pp.mask3").setupProgressPie({
mode: $.fn.progressPie.Mode.MASK,
strokeWidth: 5,
size: 120,
valueData: "val",
padding: 20,
margin: [5, 10, 20],
contentPlugin: ["image", "image"],
contentPluginOptions: [
{ //first background, i.e. layer directly behind chart, to be masked
href: "img/earth-147591.svg",
margin: 20 //neutralize global padding for this image only
},
{ //second background, i.e. layer even behind first background, not masked
href: "img/puzzlebg.png"
}
]
}).progressPie();
.pp.mask3 svg {
border: 1px dotted silver;
}
Besides the "image"
content plug-in, the file jquery-progresspie-image.js
also
contains a helper plug-in "backgroundRect"
which simply adds a background layer drawing
a rectangle around the pie (also covering the padding, i.e. if the padding
option is set,
the rectangle will enclose the pie and its padding).
You may set a stroke color in option stroke
and/or a fill color in option fill
.
At least one of these two options has to be specified. If you set a stroke color, you may
also set a stroke width via the option strokeWidth
. Note that increasing the strokeWidth
will not cause the rectangle to grow wider, the stroke width will only expand inwards, covering more
of the padding but not reducing the margin.
We'll demonstrate that in the following example: That sets a top padding of 4 pixels and a left padding
of 5 pixels, and their opposite paddings (bottom resp. right) are twice as wide (8 resp. 10 pixels).
The strokeWidth
is also set to 4. Since the strokeWidth equals the top padding,
the whole top padding is covered by the stroke, the top side of the rectangle's stroke thus touches the
pie chart. On the left side a gap of 1 pixel is left free between the rectangle and the pie, since
the left padding is 1 pixel wider than the strokeWidth
.
Since the right and bottom padding are even wider, the pie chart is not centered inside the rectangle.
$(".pp.bgrect").progressPie({
mode: $.fn.progressPie.Mode.COLOR,
size: 50,
padding: [4, 10, 8, 5],
strokeWidth: 3,
valueData: "val",
contentPlugin: "backgroundRect",
contentPluginOptions: {
stroke: "red",
fill: "silver",
strokeWidth: 4
}
});
This example is inspired by iOS's display of an app icon on the home screen during the installation of an app:
"image"
plug-in."backgroundRect"
content plug-in.
This layer darkens the background icon.IMASK
mode.
So in the places covered by the pie, the background image will shine through in its original
brightness.padding
option.$(".pp.appupdate").progressPie({
mode: $.fn.progressPie.Mode.IMASK,
padding: 20,
size: 80,
valueData: "val",
contentPlugin: ["backgroundRect", "image"],
contentPluginOptions: [
{ //options for "backgroundRect", first background directly behind chart, to be masked
fill: "rgba(0,0,0,0.6)"
},
{ //options for "image", second background behind the first, not masked
href: "img/appstore.png"
},
]
});
.pp.appupdate svg {
border-radius: 30px;
}
With a single number for the padding
(i.e. equal padding width on all
four sides) we always get a square SVG, and the background image also should be square.
If we want to use a non-square recangular background image, we'll have to set vertical
and horizontal paddings differently.
The following example is a slight variation of the previous one. We use a background image which is 640 pixels wide and 426 pixels high. Our target SVG shell be half the size (320 by 213 px). As diameter for the actual pie chart, we choose 190 pixels. This means, we'll have to add a top and bottom margin of (together) 23 pixels. To vertically center the pie on top of the image, top and bottom margin should be the same, i.e. half of 23 pixels = 11.5 pixels.
Similarly, we add a left and right padding of 65 pixels each such that the total width is 190 + 2 * 65 = 320 pixels. (Since the image is scaled to fit into the target rectangle, the latter has to have exactly the same proportions (width by height) as the photo, or else the photo will not fill the complete target rectangle but will leave blank stripes on top and bottom resp. on left and right.)
$(".pp.mustang").setupProgressPie({
mode: $.fn.progressPie.Mode.IMASK,
size: 190,
padding: [11.5, 65],
strokeWidth: 5,
valueData: "val",
contentPlugin: ["backgroundRect", "image"],
contentPluginOptions: [
{
fill: "rgba(255,255,255,0.8)"
},
{
href: "img/mustang_640x426.jpg"
}
]
}).progressPie();
By defining the padding with just two values, the pie is vertically and horizontally centered
in the example above.
We can move the pie to "focus" on the Mustang by defining different padding values
for left and right resp, top and bottom sides:
$(".pp.mustang.focus").setupProgressPie({
padding: [23, 47, 0, 83],
}).progressPie();
All background image files used in these examples were taken from .


Display: inline
hi everybody im dr nick and im displayed as an inline element
Display: inline
hi everybody im dr nick and im displayed as an inline element
Any height and width properties will have no effect. Inline elements don’t start on a new line, they appear on the same line as the content and tags beside them.
Display: inline-block
hi everybody im dr nick and im displayed as an inline-block element
The element is formatted as an inline element, but you can give it height and width values
Display Block
hi everybody im dr nick and im displayed as a block element
A block element always starts on a new line, and fills up the horizontal space of its container.


REGISTRATION
REGISTRATION
The school and lectures will be held at IIIT-Bangalore in India. Registration is all inclusive, 6 nights, breakfast, and breaks as well as a conference dinner and a cultural outing.
Full registration is $900, with $100 additional fee for a single room. The price of the school without accommodation is $500.
Thanks to generous donations from Microsoft, Intel, Infosys and IBM, between 20 and 30 grants will be available. In particular we will strive to cover the full cost of the school for students who could otherwise not attend. A limited number of travel grants are available for US students.
The school is targeted at doctoral students and researchers in areas related to programming concurrent systems. Time will be allocated for student presentations. Applicants should indicate their research area in their application, preference will be given to student working in the field.
The deadline for application for a grant is March 28, 2010. There is a 40 person limit on the number of participants, late applications will be considered only if there is room.
Please fill the following form and return it by email to tic10.
Second International Summer School on Trends in Concurrency.
TiC'10 Application Form
First Name:
Last Name:
Sex (M/F):
Date of birth:
Place of birth:
Nationality:
Position:
Affiliation:
Address:
City/State:
Country:
E-mail Address:
Fax:
Please select one:
[__] I request no grant.
[__] I request a grant
[__] I request a single room
[__] I register for school only/no accommodations
Advisor:
Institution:
E-mail:
Attach
*a Curriculum vitae
*a one page description of your research and
*a short letter of support from your advisor.
IIIT-Bangalore, India
May 23 - 30, 2010


{% load static %}
{% block meta %} {% endblock %} {% block head_scripts %} {% endblock %} {% block start_body %}{% endblock %}The primary way to contribute is by downloading folding@home and utilizing the CPU power in your computer to power simulations by researchers. These calculations are enormous and every little bit of power helps! Every simulation is like a lottery ticket, so the more tickets we buy the better our chances of jackpot.
We'll contribute computing power to folding@home on your behalf. By donating, every dollar you provide will go towards purchasing resources on the cloud to run folding@home simulations. Upon donating, we'll provide you with a donor report that shows exactly how much work your dollars enabled.