Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion problem_builder/public/js/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function PlotBlock(runtime, element) {
.enter()
.append("circle")
.attr("class", klass)
.attr("title", function(d) {
.attr("data-tooltip", function(d) {
return d[0] + ": " + d[1] + ", " + d[2];
})
.attr("cx", function(d) {
Expand Down
26 changes: 13 additions & 13 deletions problem_builder/tests/integration/test_step_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,11 @@ def check_overlays(self, step_builder, total_num_points, overlays):
point.value_of_css_property('fill') for point in points
]
self.assertTrue(all(pc == overlay['point_color'] for pc in point_colors))
# Check point titles
point_titles = set([
point.get_attribute('title') for point in points
# Check tooltips for points
tooltips = set([
point.get_attribute('data-tooltip') for point in points
])
self.assertEquals(point_titles, set(overlay['titles']))
self.assertEquals(tooltips, set(overlay['tooltips']))
# Check positions
point_positions = set([
(point.get_attribute('cx'), point.get_attribute('cy')) for point in points
Expand Down Expand Up @@ -804,7 +804,7 @@ def test_plot(self):
'selector': '.claim-default',
'num_points': 2,
'point_color': PointColors.ORANGE,
'titles': ['2 + 2 = 5: 1, 5', 'The answer to everything is 42: 5, 1'],
'tooltips': ['2 + 2 = 5: 1, 5', 'The answer to everything is 42: 5, 1'],
'positions': [
('4', '380'), # Values computed according to xScale and yScale (cf. plot.js)
('20', '396'), # Values computed according to xScale and yScale (cf. plot.js)
Expand All @@ -814,7 +814,7 @@ def test_plot(self):
'selector': '.claim-average',
'num_points': 2,
'point_color': PointColors.PURPLE,
'titles': ['2 + 2 = 5: 1, 5', 'The answer to everything is 42: 5, 1'],
'tooltips': ['2 + 2 = 5: 1, 5', 'The answer to everything is 42: 5, 1'],
'positions': [
('4', '380'), # Values computed according to xScale and yScale (cf. plot.js)
('20', '396'), # Values computed according to xScale and yScale (cf. plot.js)
Expand Down Expand Up @@ -881,7 +881,7 @@ def test_plot_with_scale_questions(self):
'selector': '.claim-default',
'num_points': 2,
'point_color': 'rgb(255, 165, 0)', # orange
'titles': ['2 + 2 = 5: 17, 83', 'The answer to everything is 42: 5, 1'],
'tooltips': ['2 + 2 = 5: 17, 83', 'The answer to everything is 42: 5, 1'],
'positions': [
('68', '68'), # Values computed according to xScale and yScale (cf. plot.js)
('20', '396'), # Values computed according to xScale and yScale (cf. plot.js)
Expand All @@ -891,7 +891,7 @@ def test_plot_with_scale_questions(self):
'selector': '.claim-average',
'num_points': 2,
'point_color': 'rgb(128, 0, 128)', # purple
'titles': ['2 + 2 = 5: 17, 83', 'The answer to everything is 42: 5, 1'],
'tooltips': ['2 + 2 = 5: 17, 83', 'The answer to everything is 42: 5, 1'],
'positions': [
('68', '68'), # Values computed according to xScale and yScale (cf. plot.js)
('20', '396'), # Values computed according to xScale and yScale (cf. plot.js)
Expand Down Expand Up @@ -993,7 +993,7 @@ def test_plot_overlays(self):
'selector': '.claim-default',
'num_points': 2,
'point_color': PointColors.ORANGE,
'titles': ['2 + 2 = 5: 1, 5', 'The answer to everything is 42: 5, 1'],
'tooltips': ['2 + 2 = 5: 1, 5', 'The answer to everything is 42: 5, 1'],
'positions': [
('4', '380'), # Values computed according to xScale and yScale (cf. plot.js)
('20', '396'), # Values computed according to xScale and yScale (cf. plot.js)
Expand All @@ -1003,7 +1003,7 @@ def test_plot_overlays(self):
'selector': '.plot-overlay.plot-overlay-0',
'num_points': 2,
'point_color': PointColors.CORAL,
'titles': ['2 + 2 = 5: 2, 3', 'The answer to everything is 42: 4, 2'],
'tooltips': ['2 + 2 = 5: 2, 3', 'The answer to everything is 42: 4, 2'],
'positions': [
('8', '388'), # Values computed according to xScale and yScale (cf. plot.js)
('16', '392'), # Values computed according to xScale and yScale (cf. plot.js)
Expand All @@ -1017,7 +1017,7 @@ def test_plot_overlays(self):
'selector': '.plot-overlay.plot-overlay-1',
'num_points': 2,
'point_color': PointColors.CORNFLOWERBLUE,
'titles': ['2 + 2 = 5: 4, 4', 'The answer to everything is 42: 1, 5'],
'tooltips': ['2 + 2 = 5: 4, 4', 'The answer to everything is 42: 1, 5'],
'positions': [
('16', '384'), # Values computed according to xScale and yScale (cf. plot.js)
('4', '380'), # Values computed according to xScale and yScale (cf. plot.js)
Expand All @@ -1031,7 +1031,7 @@ def test_plot_overlays(self):
'selector': '.plot-overlay.plot-overlay-2',
'num_points': 2,
'point_color': PointColors.OLIVE,
'titles': ['2 + 2 = 5: 3, 5', 'The answer to everything is 42: 2, 4'],
'tooltips': ['2 + 2 = 5: 3, 5', 'The answer to everything is 42: 2, 4'],
'positions': [
('12', '380'), # Values computed according to xScale and yScale (cf. plot.js)
('8', '384'), # Values computed according to xScale and yScale (cf. plot.js)
Expand All @@ -1045,7 +1045,7 @@ def test_plot_overlays(self):
'selector': '.plot-overlay.plot-overlay-3',
'num_points': 2,
'point_color': PointColors.CRIMSON,
'titles': ['2 + 2 = 5: 1, 2', 'The answer to everything is 42: 3, 3'],
'tooltips': ['2 + 2 = 5: 1, 2', 'The answer to everything is 42: 3, 3'],
'positions': [
('4', '392'), # Values computed according to xScale and yScale (cf. plot.js)
('12', '388'), # Values computed according to xScale and yScale (cf. plot.js)
Expand Down