-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: implement scores distributions charts #157
Conversation
… feat-implement-charts-123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this work @Marc-AntoineA
I think we should talk about it in a small meeting to decide next steps.
and add some doc
* fix: override updated function (and create a vegaRepresentation object) * feat: raise error if vega does not exist ; * lint: add typescript types and deactivate "no-ts-ignore" rule
… feat-implement-charts-123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Marc-AntoineA it's ready to merge for me.
I added two comment, it's up to you to decide if you do it in a new PR or in this PR, but try not to loose the information :-)
frontend/src/search-chart.ts
Outdated
try { | ||
vega; | ||
} catch (e) { | ||
if (e instanceof ReferenceError) { | ||
console.error( | ||
'Vega is required to use searchalicious-chart, you can import it using \ | ||
<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>' | ||
); | ||
return html`<p>Please install vega to use searchalicious-chart</p>`; | ||
} | ||
throw e; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of testing it every time, I would do this in firstUpdated:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
override firstUpdated(changedProperties: Map<any, any>) {
super.firstUpdated(changedProperties);
this.testVegaExists();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set a boolean vegaInstalled
in the constructor
* do not check vega everytime * use slot to allow "no-data" message
What
Create small vega histograms for current results nova, eco and nutri-score distributions.
Screenshot
Fixes bug(s)
#123
Part of