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

[Vega] Add back setMapView function #128914

Merged
merged 4 commits into from
Apr 4, 2022
Merged

Conversation

flash1293
Copy link
Contributor

Fixes #126459

This PR fixes the regression introduced by the switch to mapbox. It pulls the implementation of setMapView from the leaftlet-vega implementation (https://github.com/nyurik/leaflet-vega/blob/master/src/VegaLayer.js#L146-L207) into Kibana, adds types and uses the mapbox api instead of leaflet api under the hood.

Can be tested with this spec:

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "config": {
    "kibana": {
      "type": "map",
      "zoomControl": false,
      "scrollWheelZoom": false,
      "delayRepaint": true,
      "autosize": "fit"
    },
    "legend": {
      "direction": "vertical",
      "fillColor": "rgb(255, 255, 255)",
      "strokeColor": "rgb(0, 0, 0)",
      "padding": 10,
      "titleFontSize": 12,
      "titlePadding": 3
    }
  },
  "signals": [
    {
      "name": "sigScheduler",
      "init": "0",
      "on": [
        {
          "events": "timer{4000}",
          "update": "if(sigScheduler==7, 0, sigScheduler+1)"
        }
      ]
    },
    {
      "name": "sigrepaintMap",
      "on": [{"events": "timer{2000}", "update": "setMapView([7, 7], 6)"}]
    }
  ]
}

Play around with the setMapView call in the last row to check the various things.

@flash1293 flash1293 added release_note:fix Feature:Vega Vega visualizations Team:Visualizations Visualization editors, elastic-charts and infrastructure backport:skip This commit does not require backporting v8.2.0 labels Mar 30, 2022
@flash1293 flash1293 marked this pull request as ready for review March 30, 2022 16:31
@flash1293 flash1293 requested a review from a team as a code owner March 30, 2022 16:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@mbondyra
Copy link
Contributor

mbondyra commented Apr 4, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
visTypeVega 1.7MB 1.7MB +1.3KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

tested on Chrome, LGTM 🆗

@flash1293 flash1293 merged commit 9b3abe5 into elastic:main Apr 4, 2022
@flash1293 flash1293 added auto-backport Deprecated - use backport:version if exact versions are needed v8.3.0 backport:skip This commit does not require backporting and removed backport:skip This commit does not require backporting auto-backport Deprecated - use backport:version if exact versions are needed v8.2.0 labels Apr 4, 2022
@kibanamachine
Copy link
Contributor

⚪ Backport skipped

The pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually.

Manual backport

To create the backport manually run:

node scripts/backport --pr 128914

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Vega Vega visualizations release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Vega] Support setMapView expression for Vega Maps
5 participants