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

Document and add warning that geo-position doesn't support selection yet #3305

Closed
kanitw opened this issue Jan 25, 2018 · 2 comments
Closed
Assignees
Milestone

Comments

@kanitw
Copy link
Member

kanitw commented Jan 25, 2018

(Might be work testing if something is supported, for example, I believe that single/multi selection that projects on non-position channel should still work.)

@kanitw kanitw added this to the 2.x.x Features & Patches milestone Jan 25, 2018
@domoritz domoritz added the Geo label Feb 1, 2018
@kanitw kanitw modified the milestones: 2.x.x Features & Patches, 2.x Map Patches Mar 4, 2018
@jakevdp
Copy link
Contributor

jakevdp commented Mar 10, 2018

Here's a selection on a geo visualization that works correctly:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "config": {
    "view": {
      "height": 300,
      "width": 400
    }
  },
  "layer": [
    {
      "data": {
        "format": {
          "feature": "states",
          "type": "topojson"
        },
        "url": "https://vega.github.io/vega-datasets/data/us-10m.json"
      },
      "height": 400,
      "mark": {
        "fill": "lightgray",
        "stroke": "white",
        "type": "geoshape"
      },
      "projection": {
        "type": "albersUsa"
      },
      "title": "US State Capitols",
      "width": 700
    },
    {
      "data": {
        "url": "https://vega.github.io/vega-datasets/data/us-state-capitals.json"
      },
      "encoding": {
        "color": {
          "value": "black"
        },
        "size": {
          "condition": {
            "selection": {
              "not": "selector011"
            },
            "value": 30
          },
          "value": 100
        },
        "x": {
          "field": "lon",
          "type": "longitude"
        },
        "y": {
          "field": "lat",
          "type": "latitude"
        }
      },
      "mark": "point",
      "selection": {
        "selector011": {
          "fields": [
            "lat",
            "lon"
          ],
          "nearest": true,
          "on": "mouseover",
          "type": "single"
        }
      }
    },
    {
      "data": {
        "url": "https://vega.github.io/vega-datasets/data/us-state-capitals.json"
      },
      "encoding": {
        "opacity": {
          "condition": {
            "selection": {
              "not": "selector011"
            },
            "value": 0
          },
          "value": 1
        },
        "text": {
          "field": "city",
          "type": "nominal"
        },
        "x": {
          "field": "lon",
          "type": "longitude"
        },
        "y": {
          "field": "lat",
          "type": "latitude"
        }
      },
      "mark": {
        "align": "right",
        "dy": -5,
        "type": "text"
      }
    }
  ]
}

@kanitw kanitw changed the title Document and add warning that geo doesn't support selection yet Document and add warning that geo-position doesn't support selection yet Mar 11, 2018
@kanitw
Copy link
Member Author

kanitw commented Mar 11, 2018

That makes sense. I believe that the tricky part would be geo-position.
(Like what happen when we do interval selection over x and y.)

I'll close this since we should experiment more and we already have #3306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants