Skip to content

Commit

Permalink
Deprecate the pie properties #2789
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Dec 2, 2020
1 parent 17a32d7 commit b65941e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions documentation/docmaker.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
{ "name": "Edge arrow types", "id": "edge-arrows" },
{ "name": "Labels", "id": "labels" },
{ "name": "Compound nodes", "id": "compound-nodes" },
{ "name": "Linkout example", "id": "linkout-example" },
{ "name": "Pie style", "id": "pie-style" }
{ "name": "Linkout example", "id": "linkout-example" }
],
"disabledDemos": [
{ "name": "Multiple instances", "id": "multiple-instances" },
Expand Down
12 changes: 0 additions & 12 deletions documentation/md/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,6 @@ 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
Expand Down
4 changes: 4 additions & 0 deletions src/style/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ 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'
Expand Down

0 comments on commit b65941e

Please sign in to comment.