Skip to content

Conversation

Firenze11
Copy link

Allow passing in X, Y, Z axes title strings, displaying them along the axes.
image

@CLAassistant
Copy link

CLAassistant commented May 31, 2017

CLA assistant check
All committers have signed the CLA.

@Firenze11 Firenze11 requested a review from Pessimistress May 31, 2017 09:24
Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

@Firenze11 Very cool PR, I like it!

A possible concern: how does this work with longer labels? However, since this PR is inside an example and not a production layer, it should be OK if doesn't handle all cases.

@Pessimistress you wrote the original example.

resolution={200}
showAxis={true} />
showAxis={true}
onHover={this._onHover.bind(this)} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better to pre-bind this in constructor as Function.bind() generates a new function every render and can thus defeat shouldComponentUpdate.

Copy link
Author

Choose a reason for hiding this comment

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

Just updated.

"build": "NODE_ENV=production webpack --env.prod=true"
},
"dependencies": {
"d3-scale": "^1.0.6",
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 used in the PR? Or was it a missing dependency?

Choose a reason for hiding this comment

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

same question... is d3-scale used for scaling each axis?

Copy link
Author

Choose a reason for hiding this comment

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

This was a missing dependency before the PR was added. Yes it is used to scale the axes.


return [xTicks, yTicks, zTicks];
return [
[...xTicks, (bounds[0][0] + bounds[0][1]) / 2],

Choose a reason for hiding this comment

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

Does this PR handles the case that different axis has different ranges? You once mentioned that you'd like to scale each axis differently.

Copy link
Author

Choose a reason for hiding this comment

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

Not yet. The solution to axes scaling was implemented by @Pessimistress probably on some other branch.

@howtimeflies0
Copy link

Also.. github says you have not signed CLA

Copy link
Collaborator

@Pessimistress Pessimistress left a comment

Choose a reason for hiding this comment

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

Don't forget to update the README too


- Default: `['x', 'z', 'y']`

Strings to draw next to each axis as their titles, note that the second element is the axis that points upwards.
Copy link
Author

Choose a reason for hiding this comment

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

Updated README

@Firenze11 Firenze11 merged commit c86b838 into visgl:master May 31, 2017
howtimeflies0 pushed a commit that referenced this pull request Jun 1, 2017
showed tooltip in plotlayer example
PlotLayer add axes titles
PlotLayer add axes titles - small modification
binding methods in constructor
updating readme for axesTitles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants