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

Fix charts #2228

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Fix charts #2228

merged 1 commit into from
Aug 29, 2024

Conversation

Fosol
Copy link
Collaborator

@Fosol Fosol commented Aug 29, 2024

Fixing chart configuration options and display.

Added ability to auto resize the chart. This does not work for auto reports yet.

Summary

  • Update Subscriber app
  • Publish tno-core:0.1.141

Subscriber Report Charts

image

@Fosol Fosol added bug Something isn't working subscriber PR contains changes towards the subscriber application, tno-core update Indicates that there have been changes to our tno-core package, which can pose concurrency issues. labels Aug 29, 2024
@Fosol Fosol self-assigned this Aug 29, 2024
Publish tno-core:0.1.141
@@ -65,10 +65,12 @@ export const ReportSectionMediaAnalyticsChart = React.forwardRef<
return (
<Col key={chart.id} className="chart">
<Row className="chart-header">
<Col flex="1">
<Col flex="1" onClick={() => setShowConfig((show) => !show)}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Show/Hide chart by clicking on header.

@@ -99,15 +105,15 @@ export const ChartPicker: React.FC<IChartSectionProps> = ({ sectionIndex, chartI

<Col className="frm-in">
<label>Axis</label>
<FormikCheckbox
<Checkbox
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed issue with isHorizontal because it's the opposite of the checkbox label.


const canvasRef = React.useRef<HTMLCanvasElement>(null);

const section = values.sections[sectionIndex];
const chart = section.chartTemplates[chartIndex];
const uid = `${section.id}_${sectionIndex}`;

React.useEffect(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Auto resize the chart based on axis values. However, this only works if the user opens the chart section.

if (a > b) return 1;
return 0;
});
options.groups?.map((g) => ({ key: g, label: `${g}` })) ??
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed sorting and alignment of values to labels.

"series" => content.GroupBy(c => c.SeriesId?.ToString() ?? "NA").OrderBy(group => group.Key).Where((g) => !excludeEmptyValues || g.Key != "NA"),
"sentiment" => content.GroupBy(c => GetSentimentValue(c)?.ToString() ?? "null").Where((v) => !excludeEmptyValues || v.Key != "null").OrderByDescending(group => group.Key),
"sentimentSimple" => content.GroupBy(c => GetSentimentRating(c) ?? "null").Where((v) => !excludeEmptyValues || v.Key != "null").OrderBy(group => group.Key),
"series" => content.GroupBy(c => c.Series?.Name ?? c.OtherSeries ?? "None").Where((g) => !excludeEmptyValues || g.Key != "None").OrderBy(group => group.Key),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed series labels

@Fosol Fosol merged commit a192a8a into bcgov:dev Aug 29, 2024
3 checks passed
@Fosol Fosol deleted the charts branch August 29, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working subscriber PR contains changes towards the subscriber application, tno-core update Indicates that there have been changes to our tno-core package, which can pose concurrency issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant