Skip to content

Commit

Permalink
[New Viz] Nightingale Rose Chart (apache#3676)
Browse files Browse the repository at this point in the history
* Nightingale Rose Chart

* Review comments
  • Loading branch information
Mogball authored and mistercrunch committed Feb 4, 2018
1 parent d7453b5 commit f6abb99
Show file tree
Hide file tree
Showing 8 changed files with 663 additions and 0 deletions.
Binary file added superset/assets/images/viz_thumbnails/rose.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions superset/assets/javascripts/explore/stores/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,17 @@ export const controls = {
controlName: 'TimeSeriesColumnControl',
},

rose_area_proportion: {
type: 'CheckboxControl',
label: t('Use Area Proportions'),
description: t(
'Check if the Rose Chart should use segment area instead of ' +
'segment radius for proportioning',
),
default: false,
renderTrigger: true,
},

time_series_option: {
type: 'SelectControl',
label: t('Options'),
Expand Down
19 changes: 19 additions & 0 deletions superset/assets/javascripts/explore/stores/visTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,25 @@ export const visTypes = {
],
},

rose: {
label: t('Time Series - Nightingale Rose Chart'),
showOnExplore: true,
requiresTime: true,
controlPanelSections: [
sections.NVD3TimeSeries[0],
{
label: t('Chart Options'),
expanded: false,
controlSetRows: [
['color_scheme'],
['number_format', 'date_time_format'],
['rich_tooltip', 'rose_area_proportion'],
],
},
sections.NVD3TimeSeries[1],
],
},

partition: {
label: 'Partition Diagram',
showOnExplore: true,
Expand Down
2 changes: 2 additions & 0 deletions superset/assets/visualizations/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const VIZ_TYPES = {
deck_multi: 'deck_multi',
deck_arc: 'deck_arc',
deck_polygon: 'deck_polygon',
rose: 'rose',
};

const vizMap = {
Expand Down Expand Up @@ -97,5 +98,6 @@ const vizMap = {
[VIZ_TYPES.deck_arc]: require('./deckgl/layers/arc.jsx').default,
[VIZ_TYPES.deck_polygon]: require('./deckgl/layers/polygon.jsx').default,
[VIZ_TYPES.deck_multi]: require('./deckgl/multi.jsx'),
[VIZ_TYPES.rose]: require('./rose.js'),
};
export default vizMap;
24 changes: 24 additions & 0 deletions superset/assets/visualizations/rose.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.rose path {
transition: fill-opacity 180ms linear;
stroke: #fff;
stroke-width: 1px;
stroke-opacity: 1;
fill-opacity: 0.75;
}

.rose text {
font: 400 12px Arial, sans-serif;
pointer-events: none;
}

.rose .clickable path {
cursor: pointer;
}

.rose .hover path {
fill-opacity: 1;
}

.nv-legend .nv-series {
cursor: pointer;
}

0 comments on commit f6abb99

Please sign in to comment.