-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unlog y-axis #371
Unlog y-axis #371
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ const generateSpec = (config, plotData) => { | |
|
||
const minCellSizeItem = _.findLast( | ||
plotData, | ||
(element) => element.log_u >= Math.log(config.minCellSize), | ||
(element) => element.u >= config.minCellSize, | ||
); | ||
|
||
const minCellSizeRank = minCellSizeItem?.rank ?? 0; | ||
|
@@ -65,7 +65,7 @@ const generateSpec = (config, plotData) => { | |
}, | ||
{ | ||
type: 'filter', | ||
expr: 'datum.log_u > 0 && datum.rank > 0', | ||
expr: 'datum.u > 0 && datum.rank > 0', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed from |
||
}, | ||
], | ||
}, | ||
|
@@ -100,10 +100,10 @@ const generateSpec = (config, plotData) => { | |
}, | ||
{ | ||
name: 'yscale', | ||
type: 'linear', | ||
range: 'height', | ||
type: 'log', | ||
nice: true, | ||
domain: { data: 'plotData', field: 'log_u' }, | ||
range: 'height', | ||
domain: { data: 'plotData', field: 'u' }, | ||
}, | ||
{ | ||
name: 'color', | ||
|
@@ -120,7 +120,7 @@ const generateSpec = (config, plotData) => { | |
tickCount: 5, | ||
grid: true, | ||
zindex: 1, | ||
title: { value: config.axes.xAxisText }, | ||
title: config.axes.xAxisText, | ||
titleFont: { value: config.fontStyle.font }, | ||
labelFont: { value: config.fontStyle.font }, | ||
titleFontSize: { value: config.axes.titleFontSize }, | ||
|
@@ -133,7 +133,7 @@ const generateSpec = (config, plotData) => { | |
scale: 'yscale', | ||
grid: true, | ||
zindex: 1, | ||
title: { value: config.axes.yAxisText }, | ||
title: config.axes.yAxisText, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be a non-breaking API change for Vega. As seen from this document: https://vega.github.io/vega/docs/title/ the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed this too, it would be a nice clean-up to make. |
||
titleFont: { value: config.fontStyle.font }, | ||
labelFont: { value: config.fontStyle.font }, | ||
titleFontSize: { value: config.axes.titleFontSize }, | ||
|
@@ -147,23 +147,25 @@ const generateSpec = (config, plotData) => { | |
{ | ||
type: 'area', | ||
from: { data: 'lowerHalfPlotData' }, | ||
clip: true, | ||
encode: { | ||
enter: { | ||
x: { scale: 'xscale', field: 'rank' }, | ||
y: { scale: 'yscale', field: 'log_u' }, | ||
y2: { scale: 'yscale', value: 0 }, | ||
y: { scale: 'yscale', field: 'u' }, | ||
y2: { scale: 'yscale', value: 1 }, | ||
fill: { value: 'green' }, | ||
}, | ||
}, | ||
}, | ||
{ | ||
type: 'area', | ||
from: { data: 'higherHalfPlotData' }, | ||
clip: true, | ||
encode: { | ||
enter: { | ||
x: { scale: 'xscale', field: 'rank' }, | ||
y: { scale: 'yscale', field: 'log_u' }, | ||
y2: { scale: 'yscale', value: 0 }, | ||
y: { scale: 'yscale', field: 'u' }, | ||
y2: { scale: 'yscale', value: 1 }, | ||
fill: { value: '#f57b42' }, | ||
}, | ||
}, | ||
|
@@ -184,7 +186,7 @@ const generateSpec = (config, plotData) => { | |
], | ||
legends: legend, | ||
title: { | ||
text: { value: config.title.text }, | ||
text: config.title.text, | ||
anchor: { value: config.title.anchor }, | ||
font: { value: config.fontStyle.font }, | ||
dx: { value: config.title.dx }, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plot index is switched so that it's arranged according to the order