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

Set "y"/"Series" such that a single object/payload can draw multiple data points #293

Closed
joepavitt opened this issue Oct 24, 2023 · 1 comment · Fixed by #304
Closed
Assignees
Labels
feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do size:S - 2 Sizing estimation point

Comments

@joepavitt
Copy link
Collaborator

joepavitt commented Oct 24, 2023

Description

With the incoming 0.7.0 release, you'll be able to define series, x and y for a chart, which tells it which data points/values to render onto the chart given an incoming payload, e.g.

msg.payload = [{
    time: '2023-10-30',
    a: 3,
    b: 7
}, {
    time: '2023-10-31',
    a: 4,
    b: 5
}]

We can set the key for the x-axis to time and the key for the y-axis to a on the ui-chart in order to render {'2023-10-30', 3}, {'2023-10-31', 4}.

If we want to plot two data points/lines onto the same chart, we would still need to run a function node, and split these data points into messages like:

msg = [{
    topic: 'A',
    payload: {
        time: '2023-10-30',
        value: 3
    }
}, {
    topic: 'B',
    payload: {
        time: '2023-10-30',
        value: 7
    }
}, ...]

This feels excessive and messy. Our objective with ui-chart is everything should be as low code as possible.

As such, I propose that instead, we provide the functionality to set series to be something like multiple, and then provide an additional type for the y-axis TypedInput that is JSON, such that you can pass a list: ["a", "b"] and it will then plot two data points from a single piece of data.

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@joepavitt joepavitt added needs-triage Needs looking at to decide what to do feature-request New feature or request that needs to be turned into Epic/Story details labels Oct 24, 2023
@joepavitt joepavitt added the size:S - 2 Sizing estimation point label Oct 24, 2023
@joepavitt
Copy link
Collaborator Author

Actually, having series option for JSON, and then defining the criteria there makes more sense. If JSON type is chosen, then the y axis option should hide.

@joepavitt joepavitt moved this from Backlog to Up Next in Dashboard Backlog Oct 25, 2023
@joepavitt joepavitt moved this from Up Next to In Progress in Dashboard Backlog Oct 26, 2023
@joepavitt joepavitt self-assigned this Oct 26, 2023
@joepavitt joepavitt moved this from In Progress to Under Review in Dashboard Backlog Oct 26, 2023
@github-project-automation github-project-automation bot moved this from Under Review to Done in Dashboard Backlog Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do size:S - 2 Sizing estimation point
Projects
Status: Done
1 participant