Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Viz] Nightingale Rose Chart #3676

Merged
merged 4 commits into from
Feb 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added superset/assets/images/viz_thumbnails/rose.png
Loading
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;
}
Loading