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] Introduce fields #49068

Closed

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Oct 23, 2019

WIP

Do not merge. This is for exploration only. Work will be split up into multiple smaller PRs.

Prereq:


This makes following changes to the code base.

Introduces field interface
  getName() //unique name of the field
  isValid() //whether it is usable (e.g. partial field configs can arise when editing)
  async getType()  //data-type of the field, string, number, etc...
  async getLabel() //display of the field
  async createTooltipProperty()//create corresponding tooltip entry
Introduces 4 field types (x-pack/legacy/plugins/maps/public/layers/fields)
  • EMSRegionField: fields from EMS
  • ESAggField: fields that wrap results of aggs (e.g. geogrid-sources, or term-join metrics)
  • ESDocField: fields from ES-index pattern
  • KibanaRegionField: todo
Introduces AbstractESAggSource class (DONE in #49782)
  • top-level for ESGeoGridSource, ESPewPewSource, ESTermSource
  • Removes agg-formatting duplication and field-creation
Organizes style-modules and related react-components by type (DONE in #49803)
  • vector style modules: x-pack/legacy/plugins/maps/public/layers/styles/heatmap
  • heatmap style modules: x-pack/legacy/plugins/maps/public/layers/styles/vector
Add typing for all vector-style-properties (done in #49803)

(x-pack/legacy/plugins/maps/public/layers/styles/vector/properties)

  • dynamic_*_property: style-properties bound to a field
  • static_*_property: static properties

This also removes the duplicated branching-code from all mb-syncing operations


Introduce fields as top-level concept.

Fields are scattered and inconsistent throughout the code-base right now, wrt. display, config, and typing.

Fields should be used consistently for:

  • tooltips
  • top hits sort and split field editor
  • joins
    -- left field definitions
    -- right field definitions
  • dynamic styling properties
  • agg metrics
    -- for grid source
    -- for pewpew source

Fields are source-dependent

  • EMS
  • ES fields (agg results and docs)
  • Kibana layer configs

Later, fields should also be used for

  • automagic suggestion of styling params (e.g. categorical vs ordinal styling)
  • preloading of data-ranges (e.g. to determine intelligent breaks in color ramp)
  • identifying whether field is id-field or display-field (this is EMS top-level metadata, unused by Maps)

@thomasneirynck thomasneirynck added chore WIP Work in progress [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation labels Oct 23, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@monfera
Copy link
Contributor

monfera commented Oct 30, 2019

This seems to relate to discussions in #35481 and #44955 and plans to think up the spiritual successor of index patterns (about which there'll be a session next week)

@nreese
Copy link
Contributor

nreese commented Oct 30, 2019

This seems to relate to discussions in #35481 and #44955 and plans to think up the spiritual successor of index patterns (about which there'll be a session next week)

No, this is unrelated to those discussions. This PR just adds a fields class to the Maps app to consolidate custom labels, formatters, and meta data like max and min and percentiles.

The Maps app still uses Index patterns heavily.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@thomasneirynck
Copy link
Contributor Author

thomasneirynck commented Nov 4, 2019

This was getting split up into multiple PRs. Closing in favor of #50044

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants