Skip to content

improve explorer for non-time variables #651

@corakingdon

Description

@corakingdon
using Mimi

@defcomp example begin
    p1 = Parameter(index = [foo])
    p2 = Parameter(index = [foo, bar])
    p3 = Parameter(index = [foo, baz])
    p4 = Parameter(index = [time, bar])
    p5 = Parameter(index = [time, baz])
end

m = Model()
set_dimension!(m, :time, 10)
add_comp!(m, example)
set_dimension!(m, :foo, 1:5)
set_dimension!(m, :bar, 1:3)
set_dimension!(m, :baz, [:A, :B, :C])
set_param!(m, :example, :p1, 1:5)
set_param!(m, :example, :p2, reshape(1:15, 5, 3))
set_param!(m, :example, :p3, reshape(1:15, 5, 3))
set_param!(m, :example, :p4, reshape(1:30, 10, 3))
set_param!(m, :example, :p5, reshape(1:30, 10, 3))
run(m)
explore(m)

I think the plot for p1 should be with points instead of bars. (If the dimension values are numerical, I think they should get plotted as a scatter plot.)

Then the plots for p2 and p3 are currently meaningless, but what's interesting is that they are rendered differently from each other I guess because one of them has symbols for the second dimension and one of them has numbers for the second dimension. I think we should stick with putting the first dimension, foo, as the x axis, and then still produce a scatter plot where the second dimension is represented by different colors, like we do for p4 and p5.

There's probably more corner cases we need to define, but this is a start!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions