Skip to content
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

[tfjs-vis] Support custom tickLabels with duplicate values in heatmaps #2012

Merged
merged 6 commits into from Sep 18, 2019

Conversation

tafsiri
Copy link
Contributor

@tafsiri tafsiri commented Sep 10, 2019

Some of the code has also been simplified/refactored for clarity.

Heatmap Fix
Screen Shot 2019-09-10 at 7 27 34 PM

Confusion matrix

Screen Shot 2019-09-10 at 7 27 22 PM


This change is Reviewable

@tafsiri
Copy link
Contributor Author

tafsiri commented Sep 10, 2019

@caisq I finally got a chance to look at that long standing bug you reported.

@tafsiri tafsiri changed the title Support custom tickLabels with duplicate values in heatmaps [tfjs-vis] Support custom tickLabels with duplicate values in heatmaps Sep 11, 2019
transposed.dispose();
// Data validation
const {xTickLabels, yTickLabels} = data;
if (xTickLabels) {
Copy link
Contributor

Choose a reason for hiding this comment

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

!= null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

transposedShape}`);
// Note that we will only do a check on the first element of the second
// dimension. We do not protect users against passing in a ragged array.
if (yTickLabels) {
Copy link
Contributor

Choose a reason for hiding this comment

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

!= null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// Download the intermediate tensor values and
// dispose the transposed tensor.
const transposedValues = await transposed.array();
transposed.dispose();
Copy link
Contributor

Choose a reason for hiding this comment

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

do you have memory unit tests for this stuff?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tfjs-vis] tfvis.render.heatmap() collapses rows or columns when there are duplicate labels
3 participants