Skip to content

Commit

Permalink
Vislib Point Series updates (#9388)
Browse files Browse the repository at this point in the history
Backports PR #9044

**Commit 1:**
renaming x-axis to axis

moving y-axis methods  inside axis class

updating handler to use Axis for yAxis as well

introducting 'type' property to differ between X and Y axis

joining x_axis and y_axis into a single class axis
- splitting it into 3 subclasses (Axis, AxisLabels, AxisScale)
- converting to ES6 classes + style fixes
- adding more customization options

updating handler to work with new Axis class
- allowing handler to have multiple category/value axes (array)

converting axis_title to ES6 classes and making it work with new axis

updating column layout to support left/right top/bottom positioning of axis
- updating css min-widths to 1px (removing them breaks the code) as we dont want to reserve the space for axes that dont exist.

introducing AxisConfig class

adding ordered and values back to axis to make other parts of vislib working

renaming axis.scale to axis.axisScale

removing comments

adding scale type config

removing unnecesarry configs (never used)

adding point series chart type

updating all charts

introducing VisConfig class

moving wiggle, silluete and stacking to axis

fixing based on last spencers review

add label to zero filled values

allow custom values on catwegory axis

adding clip path

updating defaults to match current vislib implementation

seri.show parameter

vertical category axis positioning

fixing more issues

fixing broken pie charts

increasing default truncate length

fixing expandLastBucket option

* Original sha: ba74498
* Authored by ppisljar <[email protected]> on 2016-09-13T10:59:17Z

**Commit 2:**
fixing selenium tests by increasing barHeightTolerance

* Original sha: f27f8a1
* Authored by ppisljar <[email protected]> on 2016-11-22T09:40:25Z

**Commit 3:**
fixing axis alignment (1px off)

* Original sha: 3d6267e
* Authored by ppisljar <[email protected]> on 2016-11-22T12:19:37Z

**Commit 4:**
fixing layout elements min-height to 0

* Original sha: 619a495
* Authored by ppisljar <[email protected]> on 2016-11-22T12:20:20Z

**Commit 5:**
point radius should be calculated per chart

* Original sha: be16b14
* Authored by ppisljar <[email protected]> on 2016-11-22T13:35:27Z

**Commit 6:**
adding clip path to circles

* Original sha: 188131b
* Authored by ppisljar <[email protected]> on 2016-11-22T13:43:55Z

**Commit 7:**
seting min height 0 on axis

* Original sha: 231a58a
* Authored by ppisljar <[email protected]> on 2016-11-22T14:45:12Z

**Commit 8:**
adding background class

* Original sha: c41e672
* Authored by ppisljar <[email protected]> on 2016-11-22T15:27:02Z

**Commit 9:**
fixing selenium tests

* Original sha: ed1b330
* Authored by ppisljar <[email protected]> on 2016-11-22T15:27:40Z

**Commit 10:**
update visualize legend to correctly check if it should show

* Original sha: 9bd80be
* Authored by ppisljar <[email protected]> on 2016-11-23T10:33:06Z

**Commit 11:**
fixing based on CJs comments

* Original sha: 02a22d0
* Authored by ppisljar <[email protected]> on 2016-12-01T06:44:37Z

**Commit 12:**
improving stacking of negative values

* Original sha: 9d79d79
* Authored by ppisljar <[email protected]> on 2016-12-01T06:55:33Z

**Commit 13:**
updating class name to better match element

* Original sha: 628408d
* Authored by ppisljar <[email protected]> on 2016-12-01T06:56:11Z

**Commit 14:**
fixing charts with mixed (negative/positive) values

* Original sha: 682ab0b
* Authored by ppisljar <[email protected]> on 2016-12-01T09:44:49Z

**Commit 15:**
fixing test (stacking happens for grouped charts as well to handle negative values correctly)

* Original sha: 69a53ea
* Authored by ppisljar <[email protected]> on 2016-12-01T09:52:29Z

**Commit 16:**
fixing based on CJs last comments

* Original sha: 9e8d71f
* Authored by ppisljar <[email protected]> on 2016-12-01T16:05:31Z

**Commit 17:**
fixing unstable selenium test

* Original sha: f36b6fc
* Authored by ppisljar <[email protected]> on 2016-12-06T11:20:30Z
  • Loading branch information
elastic-jasper authored and ppisljar committed Dec 6, 2016
1 parent 1787c7e commit 4b66537
Show file tree
Hide file tree
Showing 96 changed files with 3,279 additions and 3,443 deletions.
4 changes: 1 addition & 3 deletions src/core_plugins/kbn_vislib_vis_types/public/area.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function HistogramVisType(Private) {
'effect on the series above it.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand All @@ -27,8 +26,7 @@ export default function HistogramVisType(Private) {
times: [],
addTimeMarker: false,
defaultYExtents: false,
setYExtents: false,
yAxis: {}
setYExtents: false
},
legendPositions: [{
value: 'left',
Expand Down
4 changes: 1 addition & 3 deletions src/core_plugins/kbn_vislib_vis_types/public/histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function HistogramVisType(Private) {
'exact numbers or percentages. If you are not sure which chart you need, you could do worse than to start here.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand All @@ -23,8 +22,7 @@ export default function HistogramVisType(Private) {
times: [],
addTimeMarker: false,
defaultYExtents: false,
setYExtents: false,
yAxis: {}
setYExtents: false
},
legendPositions: [{
value: 'left',
Expand Down
4 changes: 1 addition & 3 deletions src/core_plugins/kbn_vislib_vis_types/public/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function HistogramVisType(Private) {
'Be careful with sparse sets as the connection between points can be misleading.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand All @@ -27,8 +26,7 @@ export default function HistogramVisType(Private) {
times: [],
addTimeMarker: false,
defaultYExtents: false,
setYExtents: false,
yAxis: {}
setYExtents: false
},
legendPositions: [{
value: 'left',
Expand Down
1 change: 0 additions & 1 deletion src/core_plugins/kbn_vislib_vis_types/public/pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function HistogramVisType(Private) {
'Pro Tip: Pie charts are best used sparingly, and with no more than 7 slices per pie.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand Down
1 change: 0 additions & 1 deletion src/fixtures/vislib/_vis_fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = function VislibFixtures(Private) {
return function (visLibParams) {
let Vis = Private(VislibVisProvider);
return new Vis($visCanvas.new(), _.defaults({}, visLibParams || {}, {
shareYAxis: true,
addTooltip: true,
addLegend: true,
defaultYExtents: false,
Expand Down
1 change: 0 additions & 1 deletion src/ui/public/vis/__tests__/_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ describe('Vis Class', function () {
expect(vis.params).to.have.property('addLegend', true);
expect(vis.params).to.have.property('addTooltip', true);
expect(vis.params).to.have.property('mode', 'stacked');
expect(vis.params).to.have.property('shareYAxis', true);
});
});

Expand Down
24 changes: 24 additions & 0 deletions src/ui/public/vislib/VISLIB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Vislib general overview

`vis.js` constructor accepts vis parameters and render method accepts data. it exposes event emitter interface so we can listen to certain events like 'renderComplete'.

`vis.render` will create 'lib/vis_config' to handle configuration (applying defaults etc) and then create 'lib/handler' which will take the work over.

`vis/handler` will init all parts of the chart (based on visualization type) and call render method on each of the building blocks.

## Visualizations

Each base vis type (`lib/types`) can have a different layout defined (`lib/layout`) and different building blocks (pie charts dont have axes for example)

All base visualizations extend from `visualizations/_chart`

### Pie chart

### Map

### Point series chart

`visualizations/point_series` takes care of drawing the point series chart (no axes or titles, just the chart itself). It creates all the series defined and calls render method on them.

currently there are 3 series types available (line, area, bars), they all extend from `vislualizations/point_series/_point_series`.

Loading

0 comments on commit 4b66537

Please sign in to comment.