Skip to content
Snippets Groups Projects
Commit dfbf202d authored by Briggs, Aaron Shane's avatar Briggs, Aaron Shane
Browse files

last tweaks for mobile

parent 8fca106d
No related branches found
No related tags found
No related merge requests found
......@@ -32,9 +32,9 @@ export const drawSimpleLegend = function(div, {legendMarkerRows, layout}) {
legend.append('rect')
.attr('x', 0)
.attr('y', 0)
.attr('width', 98)
.attr('height', VERTICAL_ROW_OFFSET_PROVISIONAL_DATA_MESSAGE + 5)
.attr('y', mediaQuery(config.USWDS_MEDIUM_SCREEN) ? 0 : 5)
.attr('width', mediaQuery(config.USWDS_MEDIUM_SCREEN) ? 98 : 73)
.attr('height', mediaQuery(config.USWDS_MEDIUM_SCREEN) ? VERTICAL_ROW_OFFSET_PROVISIONAL_DATA_MESSAGE + 5 : 17)
.attr('fill', '#565c65')
.attr('rx', 2);
......@@ -44,8 +44,11 @@ export const drawSimpleLegend = function(div, {legendMarkerRows, layout}) {
.attr('x', 8)
.attr('y', VERTICAL_ROW_OFFSET_PROVISIONAL_DATA_MESSAGE)
.append('tspan')
.text('IMPORTANT').style('fill', 'white')
.append('tspan').text('data shown may be provisional - ').style('fill', 'black').attr('x', 105)
.text('IMPORTANT')
.style('fill', 'white')
.append('tspan').text('data may be provisional - ')
.style('fill', 'black')
.attr('x', mediaQuery(config.USWDS_MEDIUM_SCREEN) ? 105 : 75)
.append('tspan')
.text('learn more')
.style('fill', '#0000EE');
......
......@@ -65,7 +65,7 @@ describe('Legend module', () => {
expect(container.select('svg').size()).toBe(1);
expect(container.selectAll('line').size()).toBe(2);
expect(container.selectAll('rect').size()).toBe(1);
expect(container.selectAll('rect').size()).toBe(2); // The 'provisional data message' adds a background rectangle that is always present in the legend, making the count one more than would be expected from the mock data
expect(container.selectAll('text').size()).toBe(5); // The 'provisional data message' is a text node that is always present in the legend, making the count one more than might be expected from the mock data
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment