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

Issue #40 : Changes call .Plot on main.go to .PlotMany #43

Merged

Conversation

KarlHeitmann
Copy link
Contributor

This solves Issue #40 , cmd/asciigraph/main.go was modified to call always PlotMany.

The previous behavior is preserved. In order to add more plots to the graph, separate the values using comma: ,

I tested this with two files:

# data
1
2
3
4
5
# data_2
1,3
2,3
3,2
4,2
5,2

image

If a string don't contain a comma, and the strings.Split function is applied to it, you will have an array with one element. This edge case input is a valid argument to .PlotMany, so it will draw a single plot on the graph.

A follow up PR to this one could be modify the -sc flag so you can put a comma separated list of values (eg: -sc yellow,red), and the program the appropriate color for each plot (eg: yellow for the first plot, and red for the second plot)

@coveralls
Copy link

coveralls commented Jul 8, 2023

Pull Request Test Coverage Report for Build 8488831541

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.89%

Totals Coverage Status
Change from base Build 8471941070: 0.0%
Covered Lines: 350
Relevant Lines: 365

💛 - Coveralls

@guptarohit
Copy link
Owner

Hey @KarlHeitmann, Thank you for creating the PR 😃 💚

Coincidentally, I was also working (mastodon post) on the same feat. 😄
feat branch: https://github.com/guptarohit/asciigraph/tree/multiple-data-stream-stdin-cli

I was thinking to update README and then open PR, Great that you opened it!

Going forward, I think we can merge our changes, (cherry-pick maybe 🤔)

@guptarohit guptarohit force-pushed the master branch 3 times, most recently from 128bb8d to b929a76 Compare March 24, 2024 21:46
@guptarohit guptarohit merged commit 28aa5ed into guptarohit:master Mar 30, 2024
8 checks passed
@guptarohit guptarohit linked an issue Mar 30, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PlotMany from command line
3 participants