Commit 69347783 authored by Sanjay Yadav's avatar Sanjay Yadav

UPDATE: updated doc and removed comment sections from code base.

parent 5aed4ea8
Pipeline #32556 passed with stage
in 1 minute and 12 seconds
......@@ -513,8 +513,8 @@ Here are examples for various charts:
Growth: #cccccc # Specify color of profit line
```
The following keys can also be specified as an [expression](#expressions):
`x:`, `color:`, `opacity:`, ... TODO
The following keys can also be specified as an [expression](#expressions) and python functions:
`data:`, `x:`, `color:`, `opacity:`, `size:`.
For example, this example sets the opacity of columns named "dummy" as 0.2, and
other columns as 1.0. (TODO: change example if required)
......@@ -563,8 +563,17 @@ Example:
text:
function: "lambda v: '%.1f' % v"
style:
font-size: 10
font-size: 10 # Common css for all items(data, target, poor, good and average)
color: '#ff0000'
data: # Overwriting CSS for data
font-size: 12
fill: #ff00ff
target: # Overwriting CSS for target
font-size: 12
color: '#cccccc'
The following keys can also be specified as an [expression](#expressions) and python functions:
`data:`, `target:`, `poor:`, `good:`, `average:`, `gradient`, `text` along will all style properties such as under style section `font-size`, `opacity`, `fill`, `color` etc.
### Calendarmap
......@@ -594,6 +603,9 @@ Example:
style:
color: '#000000'
The following keys can also be specified as an [expression](#expressions) and python functions:
`data:`, `startdate:`, `lo:`, `hi:`, `weekstart:` and subelements of `style` section.
### Heatgrid
- `data`: A DataFrame.
......@@ -631,6 +643,10 @@ Example:
margin: 10
text-align: center
The following keys can also be specified as an [expression](#expressions) and python functions:
`data:`, `row:`, `column:`, `value:` and subelements of `style` section.
### Sankey
- `data`: A DataFrame.
......@@ -655,6 +671,10 @@ Example:
color:
function: "lambda g: _color.gradient(g['D'].sum() / g['E'].sum() * 2 - 1, _color.RdYlGn)"
groups: ['A', 'B', 'C']
stroke: '#ffffff'
The following keys can also be specified as an [expression](#expressions) and python functions:
`data:`, `size:`, `order:`, `text:`, `color`.
### Treemap
......@@ -684,6 +704,8 @@ Example:
text:
function: "lambda v: 'Num %d' % v['index']"
The following keys can also be specified as an [expression](#expressions) and python functions:
`data:`, `size:`, `keys:`, `values:`, `sort`, `color`, `text`.
# Development
......
......@@ -460,7 +460,7 @@ def sankey(shape, spec, data):
sankey_conf['color'] = compile_function(spec, 'color', data, handler)
sankey_conf['attrs'] = spec.get('attrs', {})
sankey_conf['sort'] = spec.get('sort')
stroke = spec.get('style', {}).get('stroke', '#ffffff')
stroke = spec.get('stroke', '#ffffff')
# Delete rectangle after geting width, height, x-position and y-position
shape._sp.delete()
elem_schema = utils.make_element()
......@@ -753,15 +753,10 @@ def bullet(shape, spec, data):
if text:
text = compile_function({'text': spec['text']}, 'text', data, handler)
# if isinstance(spec['data'], (dict,)) and 'function' in spec['data']:
spec['data'] = compile_function(spec, 'data', data, handler)
gradient = spec.get('gradient', 'RdYlGn')
# if isinstance(gradient, (dict,)) and 'function' in gradient:
# gradient = compile_function(spec, 'gradient', data, handler)
shapes = shape._parent
shape._sp.delete()
# lo = np.nanmin([data, target, poor, average, good])
lo = spec.get('lo', 0)
hi = spec.get('hi', np.nanmax([spec['data'], spec['target'], spec['poor'],
spec['average'], spec['good']]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment