Skip to content

[Maps] Introduce fields#50044

Merged
thomasneirynck merged 132 commits intoelastic:masterfrom
thomasneirynck:chore/introduce_fields
Nov 21, 2019
Merged

[Maps] Introduce fields#50044
thomasneirynck merged 132 commits intoelastic:masterfrom
thomasneirynck:chore/introduce_fields

Conversation

@thomasneirynck
Copy link
Copy Markdown
Contributor

@thomasneirynck thomasneirynck commented Nov 6, 2019

Introduces field interface
  getName() //unique name of the field
  isValid() //whether it is usable (e.g. partial field configs can arise when editing).
  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: fields from configured geojson in the .yml

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)

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@thomasneirynck
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@nreese
Copy link
Copy Markdown
Contributor

nreese commented Nov 20, 2019

I am seeing this error in console when expanding the legend with a geo_grid source

Screen Shot 2019-11-20 at 12 53 37 PM

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

Nice job getting this one across the finish line. This is a great refactor that will make it much easier to implement a lot of cool features.

LGTM
code review, tested in chrome

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@thomasneirynck thomasneirynck merged commit 05f765a into elastic:master Nov 21, 2019
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Nov 21, 2019
This introduces the `AbstractField` class and its implementations. Their use replace the ad-hoc object literals that were used to pass around field-level metadata in joins, metrics, styles, and tooltips.
thomasneirynck added a commit that referenced this pull request Nov 22, 2019
This introduces the `AbstractField` class and its implementations. Their use replace the ad-hoc object literals that were used to pass around field-level metadata in joins, metrics, styles, and tooltips.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore release_note:skip Skip the PR/issue when compiling release notes Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.6.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants