Skip to content

Commit

Permalink
Merge pull request #85 from redbearsam/remove_duplicate_method
Browse files Browse the repository at this point in the history
remove duplicate withOutOpacity method from seriesColours
  • Loading branch information
matt-hooper authored Mar 11, 2019
2 parents 68e97d3 + b7727fb commit 1807f26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/perspective-viewer-d3fc/src/js/series/lineSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*
*/
import * as fc from "d3fc";
import {withOutOpacity} from "./seriesColours.js";
import {withoutOpacity} from "./seriesColours.js";

export function lineSeries(settings, colour) {
let series = fc.seriesSvgLine();

if (colour) {
series = series.decorate(selection => {
selection.style("stroke", d => withOutOpacity(colour(d[0] && d[0].key)));
selection.style("stroke", d => withoutOpacity(colour(d[0] && d[0].key)));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,3 @@ export function withOpacity(colour) {
const toInt = offset => parseInt(colour.substring(offset, offset + 2), 16);
return `rgba(${toInt(1)},${toInt(3)},${toInt(5)},0.5)`;
}

export function withOutOpacity(colour) {
const lastComma = colour.lastIndexOf(",");
return lastComma !== -1 ? `${colour.substring(0, lastComma)})` : colour;
}

0 comments on commit 1807f26

Please sign in to comment.