Skip to content

Add timeline (by topic) in Visualizer, Add stack (by topic) in Chart, editing topic color issues#4

Open
tprasertsup wants to merge 4 commits into
sorawee:masterfrom
tprasertsup:master
Open

Add timeline (by topic) in Visualizer, Add stack (by topic) in Chart, editing topic color issues#4
tprasertsup wants to merge 4 commits into
sorawee:masterfrom
tprasertsup:master

Conversation

@tprasertsup
Copy link
Copy Markdown
Contributor

Also fix problems when loading files and all topics are in the same color

Comment thread script.js Outdated
@@ -285,23 +285,19 @@
const topicCell = $(this).find('td:eq(2)');
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let's not fetch data from html elements. We should store data in variables instead and then fetch data from them.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So I should color the topic cell when adding a new row?

Comment thread script.js Outdated
topicCell.css('background-color', `black` );
return;
if (text != null && hue == null) {
addNewTopic(text);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This seems to be at a wrong place. This function seems to be about html display, so it shouldn't modify data.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also, using hue == null as a criterion seems brittle to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I move this to when data is loaded to the web? // I wrote this to solve the case when new data is loaded and no color is associated with stored topics

Comment thread script.js Outdated
}
mapTopicColor[topic] = lastestHue;
lastestHue += 137;
if (lastestHue > 360) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What if it's exactly 360? Do you want it to reset to 0 or stay as 360?

Using modulo operation is another solution.

@tprasertsup tprasertsup changed the title Add timeline (by topic) in Visualizer Add timeline (by topic) in Visualizer, Add stack (by topic) in Chart, editing topic color issues Jul 14, 2018
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.

2 participants