Skip to content

Commit

Permalink
Some styling and tooltip hover changes
Browse files Browse the repository at this point in the history
Cleaner axis styling with more readable text
More interactive tooltip behaviour
  • Loading branch information
Andy committed Feb 18, 2019
1 parent f9be12b commit 4b4358b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/perspective-viewer-d3fc/src/js/plugin/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class D3FCChartElement extends HTMLElement {

draw() {
if (this._settings.data) {
this._chart(d3.select(this._container), this._settings);
this._chart(d3.select(this._container).attr("class", `chart ${this._chart.plugin.type}`), this._settings);
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/perspective-viewer-d3fc/src/js/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ export function tooltip(selection, settings) {
.on("mouseover", function(data) {
generateHtml(tooltipDiv, data, settings);
showTooltip(container.node(), this, tooltipDiv);
select(this).style("opacity", "0.7");
})
.on("mouseout", function() {
hideTooltip(tooltipDiv);
select(this).style("opacity", "1");
});
}

Expand Down
13 changes: 11 additions & 2 deletions packages/perspective-viewer-d3fc/src/less/chart.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,20 @@

& .y-axis text,
& .x-axis text {
fill: var(--d3fc-axis--ticks, rgb(51, 51, 51));
fill: var(--d3fc-axis--ticks, rgb(80, 80, 80));
font-size: 11px;
}
& .y-axis path,
& .x-axis path {
stroke: var(--d3fc-axis--ticks, rgb(51, 51, 51));
stroke: var(--d3fc-axis--lines, rgb(150, 160, 175));
}

&.d3_y_bar .y-axis path,
&.d3_y_line .y-axis path,
&.d3_xy_scatter .y-axis path,
&.d3_xy_scatter .x-axis path,
&.d3_x_bar .x-axis path {
visibility: hidden;
}

& .y-label {
Expand Down
1 change: 1 addition & 0 deletions packages/perspective-viewer/src/themes/material.dark.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ perspective-viewer {

--d3fc-legend-text: rgb(187, 187, 187);
--d3fc-axis--ticks: rgb(187, 187, 187);
--d3fc-axis--lines: rgb(100, 100, 100);
--d3fc-tooltip--background: #333333;
--d3fc-tooltip--color: rgb(207, 216, 220);

Expand Down

0 comments on commit 4b4358b

Please sign in to comment.