diff --git a/documentation/md/style.md b/documentation/md/style.md index a8ffd7121c..aa356a9ad5 100644 --- a/documentation/md/style.md +++ b/documentation/md/style.md @@ -338,6 +338,18 @@ The following is an example of valid background image styling using JSON. The ex ``` +## Pie chart background + +These properties allow you to create pie chart backgrounds on nodes ([demo](demos/pie-style)). Note that 16 slices maximum are supported per node, so in the properties `1 <= i <= 16`. Of course, you must specify a numerical value for each property in place of `i`. Each nonzero sized slice is placed in order of `i`, starting from the 12 o'clock position and working clockwise. + +You may find it useful to reserve a number to a particular colour for all nodes in your stylesheet. Then you can specify values for `pie-i-background-size` accordingly for each node via a [mapper](#style/mappers). This would allow you to create consistently coloured pie charts in each node of the graph based on element data. + + * **`pie-size`** : The diameter of the pie, measured as a percent of node size (e.g. `100%`) or an absolute length (e.g. `25px`). + * **`pie-i-background-color`** : The colour of the node's ith pie chart slice. + * **`pie-i-background-size`** : The size of the node's ith pie chart slice, measured in percent (e.g. `25%` or `25`). + * **`pie-i-background-opacity`** : The opacity of the node's ith pie chart slice. + + ## Edge line diff --git a/src/style/apply.js b/src/style/apply.js index 4b9f14828e..4885b30b8e 100644 --- a/src/style/apply.js +++ b/src/style/apply.js @@ -433,10 +433,6 @@ styfn.applyParsedProperty = function( ele, parsedProp ){ self.checkTriggers( ele, prop.name, fromVal, toVal ); }; - if( prop && prop.name.substr(0, 3) === 'pie' ){ - util.warn('The pie style properties are deprecated. Create charts using background images instead.'); - } - // edge sanity checks to prevent the client from making serious mistakes if( parsedProp.name === 'curve-style'