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

Sunburst Child's color #212

Merged
merged 5 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions docs/modules/ROOT/pages/user-guide/reports/sunburst.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ an arc needed to display a label (if labels are enabled).
|Slice Corner Radius |number |3 |The rounding angle of each of the arcs
in the visualization.

|Inherit color from parent |on/off |on |If enabled, starting from level 2, each
level will inherit the same color of his parent. If disabled, color will be randomly
assigned based on the color scheme.

|Auto-run query |on/off |on |When activated, automatically runs the
query when the report is displayed. When set to `off', the query is
displayed and will need to be executed manually.
Expand Down
5 changes: 4 additions & 1 deletion src/chart/visualizations/SunburstVisualization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default function SunburstVisualization(props: ExtendedChartReportProps) {

const [data, setData] = useState(commonProperties.data);
const [refreshable, setRefreshable] = useState(false);
const [back, setBack] = useState(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not needed now. I'll use it on one other feature

const settings = (props.settings) ? props.settings : {};
const legendHeight = 20;
const marginRight = (settings["marginRight"]) ? settings["marginRight"] : 24;
Expand All @@ -38,10 +39,11 @@ export default function SunburstVisualization(props: ExtendedChartReportProps) {
const enableArcLabels = (settings["enableArcLabels"] !== undefined) ? settings["enableArcLabels"] : true;
const interactive = (settings["interactive"]) ? settings["interactive"] : true;
const borderWidth = (settings["borderWidth"]) ? settings["borderWidth"] : 0;
const legend = (settings["legend"]) ? settings["legend"] : false;
const legend = (settings["legend"] !== undefined) ? settings["legend"] : false;
const arcLabelsSkipAngle = (settings["arcLabelsSkipAngle"]) ? settings["arcLabelsSkipAngle"] : 10;
const cornerRadius = (settings["cornerRadius"]) ? settings["cornerRadius"] : 3;
const colorScheme = (settings["colors"]) ? settings["colors"] : 'nivo';
const inheritColorFromParent = (settings["inheritColorFromParent"] !== undefined) ? settings["inheritColorFromParent"] : true;

return (
<>
Expand Down Expand Up @@ -70,6 +72,7 @@ export default function SunburstVisualization(props: ExtendedChartReportProps) {
enableArcLabels={enableArcLabels}
borderWidth={borderWidth}
cornerRadius={cornerRadius}
inheritColorFromParent = {inheritColorFromParent}
margin={{
top: marginTop,
right: marginRight,
Expand Down
6 changes: 6 additions & 0 deletions src/config/ReportConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,12 @@ export const REPORT_TYPES = {
type: SELECTION_TYPES.NUMBER,
default: 3
},
"inheritColorFromParent": {
label: "Inherit color from parent",
type: SELECTION_TYPES.LIST,
values: [true, false],
default: true
},
"autorun": {
label: "Auto-run query",
type: SELECTION_TYPES.LIST,
Expand Down