Skip to content

Conversation

@Tanguylo
Copy link
Collaborator

Start with a piechart with mouse over managing

@Tanguylo Tanguylo marked this pull request as draft June 13, 2022 09:12
@Tanguylo Tanguylo marked this pull request as ready for review June 17, 2022 07:54
@Tanguylo Tanguylo requested review from GhislainJ, Jeremie-Ch and xavier-ferry and removed request for Jeremie-Ch June 17, 2022 07:55
lists: any[]=[];
to_display_attributes: Attribute[]=[];

constructor(public tooltip:Tooltip,

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 ?

@Tanguylo Tanguylo linked an issue Jun 23, 2022 that may be closed by this pull request
1 task
…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];

Choose a reason for hiding this comment

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

It is really strange to have this kind of things.
This is a first way to handle the mouse. A better implementation, via a MouseHandler is the purpose of a future dev (#172).

I suggest that we keep the code in commit (174b386) as a first implementation

Copy link

@xavier-ferry xavier-ferry left a 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

Copy link
Collaborator

@GhislainJ GhislainJ left a 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


## Unreleased => [0.7.2]
### Add
- Add Piechart drawing
Copy link
Collaborator

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:
Copy link
Collaborator

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

</body>
</html>
''')

Copy link
Collaborator

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 ?

}
this.initializeObjectContext(newObject);
this.objectList.push(newObject);
console.log(newObject)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Intempestive log ?

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";
Copy link
Collaborator

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";
Copy link
Collaborator

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;
Copy link
Collaborator

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) {
Copy link
Collaborator

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,
Copy link
Collaborator

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

@GhislainJ
Copy link
Collaborator

I let some comments even if I approve the PR in order to avoid blocking stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Piechart drawing

4 participants