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

[Maps] add labels to sample data maps #54671

Merged
merged 4 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ import { RENDER_AS } from './render_as';
import { CreateSourceEditor } from './create_source_editor';
import { UpdateSourceEditor } from './update_source_editor';
import { GRID_RESOLUTION } from '../../grid_resolution';
import {
SOURCE_DATA_ID_ORIGIN,
ES_GEO_GRID,
COUNT_PROP_LABEL,
COUNT_PROP_NAME,
} from '../../../../common/constants';
import { SOURCE_DATA_ID_ORIGIN, ES_GEO_GRID, COUNT_PROP_NAME } from '../../../../common/constants';
import { i18n } from '@kbn/i18n';
import { getDataSourceLabel } from '../../../../common/i18n_getters';
import { AbstractESAggSource } from '../es_agg_source';
Expand Down Expand Up @@ -251,7 +246,6 @@ export class ESGeoGridSource extends AbstractESAggSource {
options: {
...defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options,
field: {
label: COUNT_PROP_LABEL,
name: COUNT_PROP_NAME,
origin: SOURCE_DATA_ID_ORIGIN,
},
Expand All @@ -275,7 +269,16 @@ export class ESGeoGridSource extends AbstractESAggSource {
options: {
...defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE].options,
field: {
label: COUNT_PROP_LABEL,
name: COUNT_PROP_NAME,
origin: SOURCE_DATA_ID_ORIGIN,
},
},
},
[VECTOR_STYLES.LABEL_TEXT]: {
type: DynamicStyleProperty.type,
options: {
...defaultDynamicProperties[VECTOR_STYLES.LABEL_TEXT].options,
field: {
name: COUNT_PROP_NAME,
origin: SOURCE_DATA_ID_ORIGIN,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ import {
VECTOR_STYLES,
} from '../../styles/vector/vector_style_defaults';
import { i18n } from '@kbn/i18n';
import {
SOURCE_DATA_ID_ORIGIN,
ES_PEW_PEW,
COUNT_PROP_NAME,
COUNT_PROP_LABEL,
} from '../../../../common/constants';
import { SOURCE_DATA_ID_ORIGIN, ES_PEW_PEW, COUNT_PROP_NAME } from '../../../../common/constants';
import { getDataSourceLabel } from '../../../../common/i18n_getters';
import { convertToLines } from './convert_to_lines';
import { Schemas } from 'ui/vis/editors/default/schemas';
Expand Down Expand Up @@ -138,7 +133,6 @@ export class ESPewPewSource extends AbstractESAggSource {
options: {
...defaultDynamicProperties[VECTOR_STYLES.LINE_COLOR].options,
field: {
label: COUNT_PROP_LABEL,
name: COUNT_PROP_NAME,
origin: SOURCE_DATA_ID_ORIGIN,
},
Expand All @@ -150,7 +144,6 @@ export class ESPewPewSource extends AbstractESAggSource {
options: {
...defaultDynamicProperties[VECTOR_STYLES.LINE_WIDTH].options,
field: {
label: COUNT_PROP_LABEL,
name: COUNT_PROP_NAME,
origin: SOURCE_DATA_ID_ORIGIN,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'count of kibana_sample_data_ecommerce:geoip.country_iso_code',
name: '__kbnjoin__count_groupby_kibana_sample_data_ecommerce.geoip.country_iso_code',
origin: 'join',
},
Expand Down Expand Up @@ -104,7 +103,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'count of kibana_sample_data_ecommerce:geoip.region_name',
name: '__kbnjoin__count_groupby_kibana_sample_data_ecommerce.geoip.region_name',
origin: 'join',
},
Expand Down Expand Up @@ -169,7 +167,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'count of kibana_sample_data_ecommerce:geoip.region_name',
name: '__kbnjoin__count_groupby_kibana_sample_data_ecommerce.geoip.region_name',
origin: 'join',
},
Expand Down Expand Up @@ -234,7 +231,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'count of kibana_sample_data_ecommerce:geoip.region_name',
name: '__kbnjoin__count_groupby_kibana_sample_data_ecommerce.geoip.region_name',
origin: 'join',
},
Expand Down Expand Up @@ -314,7 +310,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'taxful_total_price',
name: 'taxful_total_price',
origin: 'source',
},
Expand Down Expand Up @@ -376,7 +371,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'Count',
name: 'doc_count',
origin: 'source',
},
Expand All @@ -399,14 +393,38 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'sum of taxful_total_price',
name: 'sum_of_taxful_total_price',
origin: 'source',
},
minSize: 1,
maxSize: 20,
},
},
labelText: {
type: 'DYNAMIC',
options: {
field: {
name: 'sum_of_taxful_total_price',
origin: 'source',
},
},
},
labelSize: {
type: 'DYNAMIC',
options: {
field: {
name: 'sum_of_taxful_total_price',
origin: 'source',
},
minSize: 12,
maxSize: 24,
},
},
labelBorderSize: {
options: {
size: 'MEDIUM',
},
},
},
},
type: 'VECTOR',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'FlightTimeMin',
name: 'FlightTimeMin',
origin: 'source',
},
Expand All @@ -77,7 +76,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'DistanceMiles',
name: 'DistanceMiles',
origin: 'source',
},
Expand Down Expand Up @@ -122,7 +120,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'Count',
name: 'doc_count',
origin: 'source',
},
Expand All @@ -145,7 +142,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'avg of FlightTimeMin',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for cleaning these up

name: 'avg_of_FlightTimeMin',
origin: 'source',
},
Expand Down Expand Up @@ -190,7 +186,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'Count',
name: 'doc_count',
origin: 'source',
},
Expand All @@ -213,7 +208,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'avg of FlightDelayMin',
name: 'avg_of_FlightDelayMin',
origin: 'source',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'count of kibana_sample_data_logs:geo.src',
name: '__kbnjoin__count_groupby_kibana_sample_data_logs.geo.src',
origin: 'join',
},
Expand Down Expand Up @@ -135,7 +134,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'bytes',
name: 'bytes',
origin: 'source',
},
Expand Down Expand Up @@ -179,7 +177,6 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'Count',
name: 'doc_count',
origin: 'source',
},
Expand All @@ -202,14 +199,33 @@ const layerList = [
type: 'DYNAMIC',
options: {
field: {
label: 'sum of bytes',
name: 'sum_of_bytes',
origin: 'source',
},
minSize: 1,
minSize: 7,
maxSize: 25,
},
},
labelText: {
type: 'DYNAMIC',
options: {
field: {
name: 'doc_count',
origin: 'source',
},
},
},
labelSize: {
type: 'DYNAMIC',
options: {
field: {
name: 'doc_count',
origin: 'source',
},
minSize: 12,
maxSize: 24,
},
},
},
},
type: 'VECTOR',
Expand Down