Parameter Arguments

The following parameters can be used to as keyword arguments to modify a plot

Plot parameters

These parameters modify the entire plot.

KeywordDescriptionDefault
widthwidth of the plot in pixels500
heightheight of the plot in pixels500
layout_algorithimalgorithm for generating network layout (see Layouts)kamada_kawai
fixeduse fixed coordinates from network modelfalse
parallel_edge_offsetoffset distance between parallel edges0.05
componentsstring array of components to plotsupported_component_types

Component Parameters

These parameters modify a specific component.

Toggles

There are several component 'toggle' parameters that control whether certain display properties of components are on or off. These accept boolean values.

KeywordDescriptionDefault
show_flowwhether flow arrows are displayedfalse
show_flow_legendwhether the legend for the flow arrows is shownfalse

Color

The color arguments can accept several inputs. A single color can be specified using a color name as a symbol or a string. CSS color names are supported. In addition, hex color values in a string are supported.

powerplot(case; branch_color=:yellow)
powerplot(case; branch_color="yellow")
powerplot(case; branch_color="#FFA71A")

A color range can be created by using several colors in an array. The range is used when component data is specified.

powerplot(case; branch_color=[:red, "yellow", "#0000FF"])

A color scheme from ColorSchemes.jl can be used, but the ColorScheme must be converted to an array of colors that can be interpreted by VegaLite.

using ColorSchemes
powerplot(case; branch_color=colorscheme2array(ColorSchemes.colorschemes[:tableau_10]))
KeywordDescriptionDefault
branch_colorset the color of a branch["#3182BD", "#5798CA", "#7CAED6", "#A0C5E2", "#C6DBEF"]
dcline_colorset the color of a DC line["#756BB1", "#8F87C0", "#A8A3CE", "#C0BEDC", "#DADAEB"]
switch_colorset the color of a switch["#555555", "#808080", "#AAAAAA", "#D4D4D4", "#FFFFFF"]
transformer_colorset the color of a transformer["#8C6D31", "#A3854A", "#B99C63", "#D0B37B", "#E7CB94"]
connector_colorset the color of a connector[:gray]
gen_colorset the color of a generator["#E6550D", "#EB7433", "#F19358", "#F8B17C", "#FDD0A2"]
bus_colorset the color of a bus["#31A354", "#57B46F", "#7CC68A", "#A1D8A5", "#C7E9C0"]
load_colorset the color of a load["#843C39", "#9D5352", "#B5696B", "#CE7F83", "#E7969C"]
node_colorset the color of all buses and generatorsN/A
edge_colorset the color of all branches, DC lines, and connectorsN/A
flow_colorset the color of flow arrows:black

Size

The size argument sets the size of a component. The size does not vary with data in the base plot.

KeywordDescriptionDefault
branch_sizeset the size of a branch5
dcline_sizeset the size of a DC line5
transformer_sizeset the size of a transformer5
switch_sizeset the size of a switch5
connector_sizeset the size of a connector3
gen_sizeset the size of a generator500
bus_sizeset the size of a bus500
load_sizeset the size of a load500
node_sizeset the size of all buses and generatorsN/A
edge_sizeset the size of all branches, DC lines, and connectorsN/A
flow_arrow_size_rangeset size range for power flow arrows[500,3000]

Data

The data argument selects the data from the component dictionary to use in the visualization. The data argument can be a string or a symbol. The data value modifies the color of a component based on the color range.

powerplot(case; gen_data=:pmax)
powerplot(case; gen_data=:pmin)
KeywordDescriptionDefault
branch_dataset the data of a branch"ComponentType"
dcline_dataset the data of a DC line"ComponentType"
switch_dataset the data of a switch"ComponentType"
transformer_dataset the data of a transformer"ComponentType"
connector_dataset the data of a connector"ComponentType"
gen_dataset the data of a generator"ComponentType"
bus_dataset the data of a bus"ComponentType"
load_dataset the data of a load"ComponentType"

Datatype

The datatypes in VegaLite can be :nominal, :ordinal, or :quantintative. :nominal and :ordinal are both discrete values, and :quantitative is continuous. In the context of the simple powerplot, there is no distinction between :nominal and :ordinal.

powerplot(case; gen_data=:pg, gen_data_type=:quantitative) # the pg is continous, so use a continous scale
powerplot(case; gen_data=:index, gen_data_type=:nominal) # the index is a discrete value, so use a discrete scale
KeywordDescriptionDefault
branch_data_typeset the datatype of a branch:nominal
dcline_data_typeset the datatype of a DC line:nominal
switch_data_typeset the datatype of a switch:nominal
transformer_data_typeset the datatype of a transformer:nominal
connector_data_typeset the datatype of a connector:nominal
gen_data_typeset the datatype of a generator:nominal
bus_data_typeset the datatype of a bus:nominal
load_data_typeset the datatype of a load:nominal

Other Parameters

KeywordDescriptionDefault
:connector_dashset dash size for connectors[4,4]