Skip to content

Commit

Permalink
Merge branch 'master' into nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
netil committed Jan 24, 2024
2 parents ed49cf4 + 7e4fa71 commit 30d34c1
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 267 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
"@babel/preset-env": "^7.23.8",
"@babel/preset-typescript": "^7.23.3",
"@babel/runtime": "^7.23.8",
"@commitlint/cli": "18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@commitlint/cli": "18.5.0",
"@commitlint/config-conventional": "^18.5.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
Expand All @@ -123,8 +123,8 @@
"@types/d3": "^7.4.3",
"@types/mocha": "^10.0.6",
"@types/sinon": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"babel-helper-modules": "^6.0.0",
"babel-loader": "^9.1.3",
"babel-plugin-add-module-exports": "^1.0.4",
Expand All @@ -140,11 +140,11 @@
"chai": "^4.3.10",
"clean-webpack-plugin": "^4.0.0",
"cloc": "^2.11.0",
"core-js": "^3.35.0",
"core-js": "^3.35.1",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"css-loader": "^6.9.0",
"css-minimizer-webpack-plugin": "^5.0.1",
"css-loader": "^6.9.1",
"css-minimizer-webpack-plugin": "^6.0.0",
"d3-color": "^3.1.0",
"d3-delaunay": "^6.0.4",
"d3-format": "^3.1.0",
Expand All @@ -155,7 +155,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.0.2",
"eslint-webpack-plugin": "^4.0.1",
"exports-loader": "^4.0.0",
"exports-loader": "^5.0.0",
"hammer-simulator": "0.0.1",
"husky": "^8.0.3",
"istanbul-instrumenter-loader": "^3.0.1",
Expand All @@ -177,7 +177,7 @@
"mocha": "^10.2.0",
"node-sass": "^9.0.0",
"regenerator-runtime": "^0.14.1",
"rollup": "^4.9.5",
"rollup": "^4.9.6",
"rollup-plugin-delete": "^2.0.0",
"sass-loader": "^14.0.0",
"semantic-release": "^23.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/module/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,12 @@ const toArray = (v: CSSStyleDeclaration | any): any => [].slice.call(v);
* @private
*/
function addCssRules(style, selector: string, prop: string[]): number {
const {rootSelctor, sheet} = style;
const {rootSelector = "", sheet} = style;
const getSelector = s => s
.replace(/\s?(bb-)/g, ".$1")
.replace(/\.+/g, ".");

const rule = `${rootSelctor} ${getSelector(selector)} {${prop.join(";")}}`;
const rule = `${rootSelector} ${getSelector(selector)} {${prop.join(";")}}`;

return sheet[sheet.insertRule ? "insertRule" : "addRule"](
rule,
Expand Down
3 changes: 2 additions & 1 deletion src/scss/billboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@
}
/*-- Region --*/
.bb-region {
fill: steelblue;

rect {
fill: steelblue;
fill-opacity: .1;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/scss/theme/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ rect.bb-circle, use.bb-circle {

/*-- Region --*/
.bb-region {
fill: steelblue;

rect {
fill: steelblue;
fill-opacity: 0.5;
}

Expand Down
3 changes: 2 additions & 1 deletion src/scss/theme/datalab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ $text-font-size: 11px;

/*-- Region --*/
.bb-region {
fill: steelblue;

rect {
fill: steelblue;
fill-opacity: 0.1;
}

Expand Down
3 changes: 2 additions & 1 deletion src/scss/theme/graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ rect.bb-circle, use.bb-circle {

/*-- Region --*/
.bb-region {
fill: steelblue;

rect {
fill: steelblue;
fill-opacity: 0.1;
}

Expand Down
3 changes: 2 additions & 1 deletion src/scss/theme/insight.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ rect.bb-circle, use.bb-circle {

/*-- Region --*/
.bb-region {
fill: steelblue;

rect {
fill: steelblue;
fill-opacity: 0.1;
}

Expand Down
3 changes: 2 additions & 1 deletion src/scss/theme/modern.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ rect.bb-circle, use.bb-circle {

/*-- Region --*/
.bb-region {
fill: #71808d;

rect {
fill: #71808d;
fill-opacity: 0.1;
}

Expand Down
4 changes: 4 additions & 0 deletions test/assets/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
align-items: center;
justify-content: center;
}

.regions_class1{
fill: red;
}
10 changes: 9 additions & 1 deletion test/internals/rergions-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
/* eslint-disable */
import {expect} from "chai";
import {window} from "../../src/module/browser";
import util from "../assets/util";

// exported to be used from /test/api/region-spec.ts
Expand Down Expand Up @@ -131,13 +132,20 @@ describe("REGIONS", function() {
const {$el, scale} = chart.internal;

setTimeout(() => {
$el.region.list.each(function(d) {
$el.region.list.each(function(d, i) {
const axis = scale[d.axis];
const isX = d.axis === "x";
const rect = this.querySelector("rect");
const start = +rect.getAttribute(isX ? "x" : "y");
const size = +rect.getAttribute(isX ? "width" : "height");

// first <rect> should apply .regions_class1 rule
if (i === 0) {
const {fill} = window.getComputedStyle(this.querySelector("rect"));

expect(fill).to.be.equal("rgb(255, 0, 0)");
}

// check the diemsion
expect(start).to.be.equal(axis(isX ? d.start : d.end));
expect(start + size).to.be.equal(axis(isX ? d.end : d.start));
Expand Down
Loading

0 comments on commit 30d34c1

Please sign in to comment.