From 4e2d351bbd4371e326e06874239389f5afc52bc1 Mon Sep 17 00:00:00 2001 From: Roman Karavia <47303530+romankaravia@users.noreply.github.com> Date: Fri, 4 Sep 2020 17:54:59 +0200 Subject: [PATCH 1/3] Fix bug in highlightZeroGridLineIfPositiveAndNegative postprocessing Remove highlighting of tick lines which do not exist anymore. The following was happening before: - For charts with positive and negative values, the code to highlight the zero line was called - An exception was thrown for the access to the result of querySelector(".role-axis-tick") that returned null (because there are no y axis ticks). - The exception was caught, but all postprocessings afterwards were not carried out - for line charts: highlight zero line, outlines for annotation labels, reverse line order - for area charts: highlight zero line => these are now working again Bug introduced in 5ee98b61d867 when the y axis ticks were removed. --- chartTypes/commonPostprocessings.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/chartTypes/commonPostprocessings.js b/chartTypes/commonPostprocessings.js index 340432c4..df0aead2 100644 --- a/chartTypes/commonPostprocessings.js +++ b/chartTypes/commonPostprocessings.js @@ -170,11 +170,6 @@ const highlightZeroGridLineIfPositiveAndNegative = { .querySelector(".role-axis-grid") .querySelectorAll("line"); - const yAxisTicklines = axisElements - .item(axisIndex) - .querySelector(".role-axis-tick") - .querySelectorAll("line"); - yAxisGridlines.item(zeroTickIndex).setAttribute( "style", yAxisGridlines @@ -185,17 +180,6 @@ const highlightZeroGridLineIfPositiveAndNegative = { `stroke: ${toolRuntimeConfig.axis.labelColor}` ) ); - - yAxisTicklines.item(zeroTickIndex).setAttribute( - "style", - yAxisGridlines - .item(zeroTickIndex) - .getAttribute("style") - .replace( - `stroke: ${toolRuntimeConfig.axis.tickColor}`, - `stroke: ${toolRuntimeConfig.axis.labelColor}` - ) - ); } return document.body.innerHTML; From 4998035c497bed4218a6e5326e7aac08db9d7047 Mon Sep 17 00:00:00 2001 From: Roman Karavia <47303530+romankaravia@users.noreply.github.com> Date: Sun, 6 Sep 2020 12:46:35 +0200 Subject: [PATCH 2/3] Use package-lock.json in Dockerfile This makes sure that we are installing the same versions of dependencies as when testing locally, and prevents several bugs that would appear with the latest (v5.15.0) version of vega. There was a comment why this was not done before: We do not copy package-lock.json here as we do want the specific binary stuff (canvas) for the specific plattform of the docker container but as far as I understand (and tested), the "canvas" dependency works perfectly fine inside the docker container, even if package-lock.json was created on macOS. Even with the same version number, different binaries will be installed depending on the OS. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 566b6fc4..4f9e2b61 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ WORKDIR /app RUN apt-get update && apt-get -y install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev -# Copy package.json into work directory and install dependencies -# We do not copy package-lock.json here as we do want the specific binary stuff (canvas) for the specific plattform of the docker container +# Copy package.json and package-lock.json into work directory and install dependencies COPY package.json /app/package.json +COPY package-lock.json /app/package-lock.json RUN npm install --production # Copy everthing else in work directory From eb98fb7e03c097ec4b81b2cb93410134707d461c Mon Sep 17 00:00:00 2001 From: Roman Karavia <47303530+romankaravia@users.noreply.github.com> Date: Fri, 4 Sep 2020 18:21:07 +0200 Subject: [PATCH 3/3] v3.2.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3eea60d9..eb6791e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "q-chart", - "version": "3.2.1", + "version": "3.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d9fd822e..19d982b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "q-chart", - "version": "3.2.1", + "version": "3.2.2", "description": "", "main": "index.js", "scripts": {