WISPO-POP / PowerPlots.jl

Functions plot PowerModels networks
BSD 3-Clause "New" or "Revised" License
22 stars 2 forks source link

How should multi-networks be handled? #33

Closed noahrhodes closed 2 years ago

noahrhodes commented 3 years ago
  1. Dis-allow multi-networks?

    • require a user to pass a single network from the multi-network
  2. Create a separate plot for each network automatically?

  3. Use html to create a window for embedding plots, with interaction to click to each network

(ranked by increasing difficult)

Any other ideas?

noahrhodes commented 3 years ago

Use a slider to change a value that filters the data according to the multi-network id?

https://vega.github.io/vega-lite/docs/bind.html

noahrhodes commented 3 years ago

Here is a vegalite code example of using a filter connected to a slider. Can use this to filter the network id of a multinetwork

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Drag the sliders to highlight points.",
  "data": {"url": "data/cars.json"},
  "transform": [
      {"calculate": "year(datum.Year)", "as": "Year"},
      {"filter": {"param": "CylYr"}}
    ],
  "layer": [{
    "params": [{
      "name": "CylYr",
      "value": [{"Cylinders": 4, "Year": 1977}],
      "select": {"type": "point", "fields": ["Cylinders", "Year"]},
      "bind": {
        "Cylinders": {"input": "range", "min": 3, "max": 8, "step": 1},
        "Year": {"input": "range", "min": 1969, "max": 1981, "step": 1}
      }
    }],
    "mark": "circle",
    "encoding": {
      "x": {"field": "Horsepower", "type": "quantitative"},
      "y": {"field": "Miles_per_Gallon", "type": "quantitative"},
      "color": {
        "condition": {"param": "CylYr", "field": "Origin", "type": "nominal"},
        "value": "grey"
      }
    }
  }, {
    "transform": [{"filter": {"param": "CylYr"}}],
    "mark": "circle",
    "encoding": {
      "x": {"field": "Horsepower", "type": "quantitative"},
      "y": {"field": "Miles_per_Gallon", "type": "quantitative"},
      "color": {"field": "Origin", "type": "nominal"},
      "size": {"value": 100}
    }
  }]
}
noahrhodes commented 2 years ago

closed by #86