-
Notifications
You must be signed in to change notification settings - Fork 0
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/piechart #168
base: dev
Are you sure you want to change the base?
Feat/piechart #168
Conversation
src/primitives.ts
Outdated
to_display_attributes: Attribute[]=[]; | ||
|
||
constructor(public tooltip:Tooltip, |
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.
Can remove tooltip
Can type_ be removed from the constructor ?
…hanges following the PR review
…nymore PlotPieChart's one and change radius to have a standard PieChart instantiated in plots with a .transform(matrix)
clicked: boolean = false; | ||
selected: boolean = false; | ||
points_inside: PiePart[] = [this]; |
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.
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.
As said in comments, some wip related to mouse handling is already implemented here but it does not prevent me from approving this PR
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 didn't perform the review for most of the subplot.ts file as the diff was horrendous and changes were mostly convention stuff
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
|
|||
## Unreleased => [0.7.2] | |||
### Add | |||
- Add Piechart drawing |
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.
Should update changelog to set it in the right version (ie. current)
name: str = ''): | ||
|
||
self.slicing_variable = slicing_variable | ||
if not data_samples: |
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.
if data_samples is None:
would be the right check
@@ -225,3 +225,35 @@ | |||
</body> | |||
</html> | |||
''') | |||
|
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.
Is this template any different than the cypress' one ? Can't they be mutualized ? Should they ?
@@ -101,6 +101,7 @@ export class MultiplePlots { | |||
} | |||
this.initializeObjectContext(newObject); | |||
this.objectList.push(newObject); | |||
console.log(newObject) |
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.
Intempestive log ?
@@ -2,6 +2,7 @@ import { string_to_rgb, rgb_to_string, string_to_hex, rgb_to_hex } from "./color | |||
import { EdgeStyle, SurfaceStyle, PointStyle, TextStyle } from "./style"; | |||
import { set_default_values, genColor, drawLines, getCurvePoints, Tooltip, Axis, PointFamily, Attribute, TypeOf } from "./utils"; | |||
import { Shape, List, MyObject } from "./toolbox"; | |||
import { ContextExclusionPlugin } from "webpack"; |
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.
Unused import ? Most probably due to VS Code auto import feature
@@ -1,3 +1,4 @@ | |||
import { ListenOptions } from "net"; |
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.
Auto vs code import ?
this.latest_selected_points_index = []; | ||
for (let i=0; i<this.latest_selected_points.length; i++) { | ||
if (this.plotObject instanceof PieChart) { | ||
elements_list = this.plotObject.pieParts; |
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.
Future : To keep in mind while refactoring : In order to avoid these kind of if statements everywhere, as any "plotObject" should inherit from a base class, we should define a getter (js equivalent of a python property), that would enable high customizability when we call the getter as well as guarantee simplicity and genericity.
For ex, here, the base class would define the getter as return this.point_list
where PieChar would overwrite this behavior to call and yield its own "way" of representing itself, ie. return this.pieParts
And the code would only call for the getter
this.plotObject.graphs[i].point_list[j].selected = false; | ||
this.plotObject.graphs[i].point_list[j].clicked = false; | ||
} | ||
} | ||
} | ||
} else if (this.plotObject instanceof PieChart) { |
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.
Exact same comment as the previous one here, but with a function.
Globally speaking, wherever there are a lot of "if/else if/else" statements, there is almost everytime a better way to do it by using Oriented Object stuff.
See dc's schema refactor for an example
} | ||
plot_datas: any; | ||
selected: boolean = true; | ||
public constructor(public data: any, |
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.
[Wait for refactor] Be aware of JS Indentation Conventions here
I let some comments even if I approve the PR in order to avoid blocking stuff |
Start with a piechart with mouse over managing