Conversation
src/primitives.ts
Outdated
| lists: any[]=[]; | ||
| to_display_attributes: Attribute[]=[]; | ||
|
|
||
| constructor(public tooltip:Tooltip, |
There was a problem hiding this comment.
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)
| path: Path2D; | ||
| clicked: boolean = false; | ||
| selected: boolean = false; | ||
| points_inside: PiePart[] = [this]; |
xavier-ferry
left a comment
There was a problem hiding this comment.
As said in comments, some wip related to mouse handling is already implemented here but it does not prevent me from approving this PR
GhislainJ
left a comment
There was a problem hiding this comment.
I didn't perform the review for most of the subplot.ts file as the diff was horrendous and changes were mostly convention stuff
|
|
||
| ## Unreleased => [0.7.2] | ||
| ### Add | ||
| - Add Piechart drawing |
There was a problem hiding this comment.
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.
if data_samples is None: would be the right check
| </body> | ||
| </html> | ||
| ''') | ||
|
|
There was a problem hiding this comment.
Is this template any different than the cypress' one ? Can't they be mutualized ? Should they ?
| } | ||
| this.initializeObjectContext(newObject); | ||
| this.objectList.push(newObject); | ||
| console.log(newObject) |
| 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.
Unused import ? Most probably due to VS Code auto import feature
| @@ -1,3 +1,4 @@ | |||
| import { ListenOptions } from "net"; | |||
| 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.
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.
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.
[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