diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5b380c70e..4b6ac617d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,6 +29,7 @@ jobs: node-version: 22 registry-url: 'https://registry.npmjs.org' - run: | + yarn install yarn npm-publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/fluid/example/text-viz/left-barchart-table.fld b/fluid/example/text-viz/left-barchart-table.fld index af5c7d21e..83d87adec 100644 --- a/fluid/example/text-viz/left-barchart-table.fld +++ b/fluid/example/text-viz/left-barchart-table.fld @@ -1,6 +1,5 @@ [ { type: "Total", emissions: 1.35 }, { type: "CO2", emissions: 1.1 }, - { type: "Non-CO2", emissions: 0.41 }, - { type: "Aerosols & Land", emissions: -0.17} + { type: "Non-CO2", emissions: 0.41 } ] \ No newline at end of file diff --git a/fluid/example/text-viz/right-barchart-table.fld b/fluid/example/text-viz/right-barchart-table.fld index 0fc852235..d1c5cf6c8 100644 --- a/fluid/example/text-viz/right-barchart-table.fld +++ b/fluid/example/text-viz/right-barchart-table.fld @@ -1,6 +1,5 @@ [ { type: "Total", emissions: 2.7 }, { type: "CO2", emissions: 2.1 }, - { type: "Non-CO2", emissions: 0.6 }, - { type: "Aerosols & Land", emissions: -0.21} + { type: "Non-CO2", emissions: 0.6 } ] \ No newline at end of file diff --git a/src/App/View/BarChart.js b/src/App/View/BarChart.js index e009e74bc..29cf190f0 100644 --- a/src/App/View/BarChart.js +++ b/src/App/View/BarChart.js @@ -110,7 +110,7 @@ function drawBarChart_ ( const nearest = 10, y_max = Math.ceil(Math.max(...stackedBars.map(d => barHeight(d.bars))) / nearest) * nearest const y = d3.scaleLinear() - .domain([-y_max, y_max]) + .domain([0, y_max]) .range([height, 0]) .nice() const tickEvery_n = tickEvery(y_max), @@ -145,9 +145,9 @@ function drawBarChart_ ( .append('rect') .attr('class', 'bar') .attr('x', bar => { return x(bar.x) }) - .attr('y', bar => { return y(Math.max(bar.y + bar.height, 0)) }) + .attr('y', bar => { return y(bar.y + bar.height) }) .attr('width', x.bandwidth()) - .attr('height', bar => { return Math.abs(height - y(bar.height) - strokeWidth - y(0)) }) // stop bars overplotting + .attr('height', bar => { return height - y(bar.height) - strokeWidth }) // stop bars overplotting .attr('stroke-width', _ => strokeWidth) const legendLineHeight = 15,