Skip to content

Commit

Permalink
Merge pull request #258 from nzzdev/release-3.8.0
Browse files Browse the repository at this point in the history
Release 3.8.0
  • Loading branch information
dnlbln authored Mar 28, 2022
2 parents 230af8b + 32a1f42 commit 3a20aac
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 5,350 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

Q chart is a charting tool based on [Vega](https://github.com/vega/vega) for [Q](https://q.tools)

## Important Notices

- Do not update vega above 5.21 unless this oustanding [bug](https://github.com/vega/vega/issues/3451) is fixed and all test pass after updating.

## Table of contents

- [Installation](#installation)
Expand Down
27 changes: 27 additions & 0 deletions chartTypes/line/mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ module.exports = function getMappings() {
}
},
},
{
path: "item.options.lineChartOptions.yScaleType",
mapToSpec: function (yScaleType, spec) {
objectPath.set(spec, "scales.1.type", yScaleType);

// Log scales must have a min value that is non-zero.
// If no minValue is set for the y-axis we will set it to 1 here,
// otherwise the linechart will be misdrawn and the user will be confused.
if (spec.scales[1].domainMin === undefined) {
objectPath.set(spec, "scales.1.domainMin", 1);
}
},
},
{
path: "item.options.lineChartOptions.minValue",
mapToSpec: function (minValue, spec, mappingData) {
Expand Down Expand Up @@ -212,6 +225,20 @@ module.exports = function getMappings() {
objectPath.set(spec, "scales.1.domainMax", maxValue / divisor);
},
},
{
// This is currently turned off in the frontend because for some reason vega still
// does some processing over the values and does not show the exact values we define.
path: "item.options.lineChartOptions.yAxisTicks",
mapToSpec: function (values, spec, mappingData) {
if (values.length === 0) {
values = undefined;
} else {
values = values.split(",");
}

objectPath.set(spec, "axes.1.values", values);
}
},
{
path: "item.options.lineChartOptions.reverseYScale",
mapToSpec: function (reverseYScale, spec) {
Expand Down
Loading

0 comments on commit 3a20aac

Please sign in to comment.