Skip to content
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

Visualize refactor (bis) #12715

Merged
merged 41 commits into from
Jul 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f684e02
converting Vis to es6 class
ppisljar Mar 31, 2017
aa49330
<visualize>, <visualization> and <visualization-editor>
ppisljar Jun 7, 2017
33c95ba
editor, responseHandler and requestHandler registries
ppisljar Jun 7, 2017
0e74519
updating visualize editor app
ppisljar Jun 7, 2017
a374898
vis, default editor, request handlers and vis types
ppisljar Jun 7, 2017
b0bae75
updating vis types
ppisljar Jun 7, 2017
068eaae
updating kibana to work with new visualize
ppisljar Jun 7, 2017
4c2bd88
migrating existing visualizations
ppisljar Jun 7, 2017
ad48a4b
fixing bugs with rebase
ppisljar Jun 7, 2017
86b98e3
fixing tests
ppisljar Jun 26, 2017
d0bc2d6
fixing renderComplete issues with editor
ppisljar Jun 27, 2017
1851bc9
map updates
thomasneirynck Jun 28, 2017
a34f83c
fixing maps zoom
ppisljar Jun 28, 2017
1574362
fixing based on nathans review
ppisljar Jun 29, 2017
df1e67e
fixing render complete issue and doulbe rendering with maps
ppisljar Jun 29, 2017
c5239cb
trying to get maps in order .... wip
ppisljar Jun 29, 2017
a41e6b4
fixing metric chart type auto changing
ppisljar Jun 29, 2017
e3e6cd0
changing the rendering process a bit
ppisljar Jun 29, 2017
ae9aea4
removing resize method from visualizations
thomasneirynck Jun 29, 2017
7d24a1c
minor simplifications in coordinate map viz
thomasneirynck Jun 30, 2017
56d2e6e
more simplications now we only have single render
thomasneirynck Jun 30, 2017
43c75ee
minor fixes
thomasneirynck Jun 30, 2017
c63975a
do not recreate layer when not necessary
thomasneirynck Jun 30, 2017
cdfc979
minor changes
thomasneirynck Jun 30, 2017
9933741
fixing maps bounding box filter
ppisljar Jul 3, 2017
58aa0b5
fixing desaturation option
ppisljar Jul 3, 2017
fbe8f37
fix zoom settings when toggling between WMS/basemap
thomasneirynck Jul 4, 2017
d010bca
adding status to the render method (to figure out what changed)
ppisljar Jul 4, 2017
6760f27
fixing legend open icon going out of page
ppisljar Jul 5, 2017
5999741
skip index selection for timelion
ppisljar Jul 5, 2017
648fcd7
timelion brush fix
ppisljar Jul 5, 2017
a211632
fixing circular json issue
ppisljar Jul 5, 2017
9b1d657
fix faulty rebase
thomasneirynck Jul 6, 2017
c81d12f
fixing updateStatus
ppisljar Jul 6, 2017
391b947
removing timelion requesthandler registration
ppisljar Jul 6, 2017
b76cdac
removing double slash
ppisljar Jul 6, 2017
233660c
fixing maps
ppisljar Jul 6, 2017
a3ed917
add debug statement
thomasneirynck Jul 7, 2017
5e64ce7
test CI with guard statement
thomasneirynck Jul 7, 2017
6fc6a41
fixing rebase
ppisljar Jul 7, 2017
40909bf
move service_setting to make accessible in xpack
thomasneirynck Jul 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 83 additions & 82 deletions src/core_plugins/kbn_vislib_vis_types/public/area.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { VisVisTypeProvider } from 'ui/vis/vis_type';
import { VislibVisTypeVislibVisTypeProvider } from 'ui/vislib_vis_type/vislib_vis_type';
import { VisSchemasProvider } from 'ui/vis/schemas';
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { VisSchemasProvider } from 'ui/vis/editors/default/schemas';
import { CATEGORY } from 'ui/vis/vis_category';
import pointSeriesTemplate from 'plugins/kbn_vislib_vis_types/editors/point_series.html';
import image from './images/icon-area.svg';

export default function PointSeriesVisType(Private) {
const VisType = Private(VisVisTypeProvider);
const VislibVisType = Private(VislibVisTypeVislibVisTypeProvider);
const VisFactory = Private(VisFactoryProvider);
const Schemas = Private(VisSchemasProvider);

return new VislibVisType({
return VisFactory.createVislibVisualization({
name: 'area',
title: 'Area',
image,
description: 'Emphasize the quantity beneath a line chart',
category: VisType.CATEGORY.BASIC,
params: {
category: CATEGORY.BASIC,
visConfig: {
defaults: {
type: 'area',
grid: {
categoryLines: false,
style: {
Expand All @@ -29,8 +29,7 @@ export default function PointSeriesVisType(Private) {
type: 'category',
position: 'bottom',
show: true,
style: {
},
style: {},
scale: {
type: 'linear'
},
Expand All @@ -48,8 +47,7 @@ export default function PointSeriesVisType(Private) {
type: 'value',
position: 'left',
show: true,
style: {
},
style: {},
scale: {
type: 'linear',
mode: 'normal'
Expand Down Expand Up @@ -84,31 +82,34 @@ export default function PointSeriesVisType(Private) {
times: [],
addTimeMarker: false,
},
positions: ['top', 'left', 'right', 'bottom'],
chartTypes: [{
value: 'line',
text: 'line'
}, {
value: 'area',
text: 'area'
}, {
value: 'histogram',
text: 'bar'
}],
axisModes: ['normal', 'percentage', 'wiggle', 'silhouette'],
scaleTypes: ['linear', 'log', 'square root'],
chartModes: ['normal', 'stacked'],
interpolationModes: [{
value: 'linear',
text: 'straight',
}, {
value: 'cardinal',
text: 'smoothed',
}, {
value: 'step-after',
text: 'stepped',
}],
editor: pointSeriesTemplate,
},
editorConfig: {
collections: {
positions: ['top', 'left', 'right', 'bottom'],
chartTypes: [{
value: 'line',
text: 'line'
}, {
value: 'area',
text: 'area'
}, {
value: 'histogram',
text: 'bar'
}],
axisModes: ['normal', 'percentage', 'wiggle', 'silhouette'],
scaleTypes: ['linear', 'log', 'square root'],
chartModes: ['normal', 'stacked'],
interpolationModes: [{
value: 'linear',
text: 'straight',
}, {
value: 'cardinal',
text: 'smoothed',
}, {
value: 'step-after',
text: 'stepped',
}],
},
optionTabs: [
{
name: 'advanced',
Expand All @@ -118,50 +119,50 @@ export default function PointSeriesVisType(Private) {
},
{ name: 'options', title: 'Panel Settings', editor: pointSeriesTemplate },
],
},
schemas: new Schemas([
{
group: 'metrics',
name: 'metric',
title: 'Y-Axis',
aggFilter: ['!geo_centroid'],
min: 1,
defaults: [
{ schema: 'metric', type: 'count' }
]
},
{
group: 'metrics',
name: 'radius',
title: 'Dot Size',
min: 0,
max: 1,
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality']
},
{
group: 'buckets',
name: 'segment',
title: 'X-Axis',
min: 0,
max: 1,
aggFilter: '!geohash_grid'
},
{
group: 'buckets',
name: 'group',
title: 'Split Series',
min: 0,
max: 1,
aggFilter: '!geohash_grid'
},
{
group: 'buckets',
name: 'split',
title: 'Split Chart',
min: 0,
max: 1,
aggFilter: '!geohash_grid'
}
])
schemas: new Schemas([
{
group: 'metrics',
name: 'metric',
title: 'Y-Axis',
aggFilter: ['!geo_centroid'],
min: 1,
defaults: [
{ schema: 'metric', type: 'count' }
]
},
{
group: 'metrics',
name: 'radius',
title: 'Dot Size',
min: 0,
max: 1,
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality']
},
{
group: 'buckets',
name: 'segment',
title: 'X-Axis',
min: 0,
max: 1,
aggFilter: '!geohash_grid'
},
{
group: 'buckets',
name: 'group',
title: 'Split Series',
min: 0,
max: 1,
aggFilter: '!geohash_grid'
},
{
group: 'buckets',
name: 'split',
title: 'Split Chart',
min: 0,
max: 1,
aggFilter: '!geohash_grid'
}
])
}
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
id="gaugeType"
class="kuiSelect kuiSideBarSelect"
ng-model="vis.params.gauge.gaugeType"
ng-options="mode for mode in vis.type.params.gaugeTypes"
ng-options="mode for mode in collections.gaugeTypes"
></select>
</div>
</div>
Expand Down Expand Up @@ -183,7 +183,7 @@
id="colorSchema"
class="kuiSelect kuiSideBarSelect"
ng-model="vis.params.gauge.colorSchema"
ng-options="mode for mode in vis.type.params.colorSchemas"
ng-options="mode for mode in collections.colorSchemas"
></select>
</div>
<div class="text-info text-center" ng-show="customColors" ng-click="resetColors()">reset colors</div>
Expand Down Expand Up @@ -255,7 +255,7 @@
id="gaugeColorMode"
class="kuiSelect kuiSideBarSelect"
ng-model="vis.params.gauge.gaugeColorMode"
ng-options="mode for mode in vis.type.params.gaugeColorMode"
ng-options="mode for mode in collections.gaugeColorMode"
></select>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.directive('gaugeOptions', function () {
template: gaugeOptionsTemplate,
replace: true,
link: function ($scope) {

$scope.collections = $scope.vis.type.editorConfig.collections;
$scope.showColorRange = true;

$scope.$watch('vis.params.gauge.gaugeType', type => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
id="colorSchema"
class="kuiSelect kuiSideBarSelect"
ng-model="vis.params.colorSchema"
ng-options="mode for mode in vis.type.params.colorSchemas"
ng-options="mode for mode in collections.colorSchemas"
></select>
</div>
<div
Expand Down Expand Up @@ -39,7 +39,7 @@
id="axisScale"
class="kuiSelect kuiSideBarSelect"
ng-model="vis.params.valueAxes[0].scale.type"
ng-options="mode for mode in vis.type.params.scales"
ng-options="mode for mode in collections.scales"
></select>
</div>
</div>
Expand Down Expand Up @@ -141,15 +141,15 @@
ng-click="removeRange($index)"
class="kuiButton kuiButton--danger kuiButton--small"
>
<span class="kuiIcon fa-times"><span>
<span class="kuiIcon fa-times"></span>
</button>
</td>
</tr>
</table>

<div class="hintbox" ng-show="!vis.params.colorsRange.length">
<p>
<span class="kuiIcon fa-danger text-danger"><span>
<span class="kuiIcon fa-danger text-danger"></span>
<strong>Required:</strong> You must specify at least one range.
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module.directive('heatmapOptions', function () {
template: heatmapOptionsTemplate,
replace: true,
link: function ($scope) {

$scope.collections = $scope.vis.type.editorConfig.collections;

const verticalRotation = 270;
$scope.showColorRange = false;
$scope.showLabels = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
id="categoryAxisPosition"
class="kuiSelect kuiSideBarSelect"
ng-model="vis.params.categoryAxes[0].position"
ng-options="mode for mode in vis.type.params.positions"
ng-options="mode for mode in vis.type.editorConfig.collections.positions"
></select>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
id="{{ 'seriesType' + $index }}"
class="kuiSelect kuiSideBarSelect"
ng-model="chart.type"
ng-options="mode.value as mode.text for mode in vis.type.params.chartTypes"
ng-options="mode.value as mode.text for mode in vis.type.editorConfig.collections.chartTypes"
></select>
</div>
</div>
Expand All @@ -54,7 +54,7 @@
id="{{ 'seriesMode' + $index }}"
class="kuiSelect kuiSideBarSelect"
ng-model="chart.mode"
ng-options="mode for mode in vis.type.params.chartModes"
ng-options="mode for mode in vis.type.editorConfig.collections.chartModes"
></select>
</div>
</div>
Expand Down Expand Up @@ -86,7 +86,7 @@
id="{{ 'lineMode' + $index }}"
class="kuiSelect kuiSideBarSelect"
ng-model="chart.interpolate"
ng-options="mode.value as mode.text for mode in vis.type.params.interpolationModes"
ng-options="mode.value as mode.text for mode in vis.type.editorConfig.collections.interpolationModes"
>
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.directive('vislibSeries', function () {
return $scope.vis.params.seriesParams.map(series => series.type).join();
}, () => {
const types = _.uniq(_.map($scope.vis.params.seriesParams, 'type'));
$scope.savedVis.type = types.length === 1 ? types[0] : 'histogram';
$scope.vis.type.type = types.length === 1 ? types[0] : 'histogram';
});

$scope.$watch('vis.params.valueAxes.length', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
class="kuiSelect kuiSideBarSelect"
ng-change="updateAxisName(axis)"
ng-model="axis.position"
ng-options="mode disable when isPositionDisabled(mode) for mode in vis.type.params.positions"
ng-options="mode disable when isPositionDisabled(mode) for mode in vis.type.editorConfig.collections.positions"
></select>
</div>
</div>
Expand All @@ -98,7 +98,7 @@
id="{{ 'valueAxisMode' + $index }}"
class="kuiSelect kuiSideBarSelect"
ng-model="axis.scale.mode"
ng-options="mode for mode in vis.type.params.axisModes"
ng-options="mode for mode in vis.type.editorConfig.collections.axisModes"
></select>
</div>
</div>
Expand All @@ -112,7 +112,7 @@
id="{{ 'valueAxisScaleType' + $index }}"
class="kuiSelect kuiSideBarSelect"
ng-model="axis.scale.type"
ng-options="type for type in vis.type.params.scaleTypes"
ng-options="type for type in vis.type.editorConfig.collections.scaleTypes"
></select>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<select
class="form-control"
ng-model="vis.params.legendPosition"
ng-options="position.value as position.text for position in vis.type.params.legendPositions"
ng-options="position.value as position.text for position in vis.type.editorConfig.collections.legendPositions"
>
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('point series editor', function () {
function makeConfig() {
return {
type: 'line',
params: lineVisType.params.defaults,
params: lineVisType.visConfig.defaults,
aggs: [
{ type: 'count', schema: 'metric', params: { field: 'bytes' } },
{ type: 'terms', schema: 'segment', params: { field: 'machine.os' } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
id="legendPosition"
class="kuiSelect kuiSideBarSelect"
ng-model="vis.params.legendPosition"
ng-options="position.value as position.text for position in vis.type.params.legendPositions"
ng-options="position.value as position.text for position in vis.type.editorConfig.collections.legendPositions"
></select>
</div>
</div>
Expand Down
Loading