-
Notifications
You must be signed in to change notification settings - Fork 99
Pareto Chart #423
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
Comments
I'm working on this |
hey @rockfaith75 i think you worked on this together with @smoothdeveloper. Is one of you still planning to finish this? If not, I would greatly appreciate if you could link what you ended up with during the hackathon (e.g. a script or notebook you worked in) so others can use it as a foundation to tackle this chart. If also do not have anything to link, no worries, please just tell me that this issue is up-for-grabs again. Thanks ❤️ |
Thanks Super😍Kevin!!!
The project is working with random data, I've just come back home to Italy from the beautiful Berlin and in the next days Gautier is calling me via zoom to clean up and test so we can commit, is it ok?
Could you please give me your number just in case?
Mine is +393493823145 - John Casagranda
Thank You Kevin for the great and crucial support during the awesome F# for Data Science Conference at Novotel, congratulations once again to the Team!
Come to visit me in Italy whenever you want, welcome anytime, R'n'R!!!
🎸💜💫
John JC Casagranda
… On 16 Oct 2023, at 14:49, Kevin Schneider ***@***.***> wrote:
hey @rockfaith75 <https://github.com/rockfaith75> i think you worked on this together with @smoothdeveloper <https://github.com/smoothdeveloper>. Is one of you still planning to finish this? If not, I would greatly appreciate if you could link what you ended up with during the hackathon (e.g. a script or notebook you worked in) so others can use it as a foundation to tackle this chart. If also do not have anything to link, no worries, please just tell me that this issue is up-for-grabs again. Thanks ❤️
—
Reply to this email directly, view it on GitHub <#423 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BC53QH4PTQO3BP3B7VO7M43X7UUMHAVCNFSM6AAAAAA5DI3IG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRUGQYTMMZRGM>.
You are receiving this because you were mentioned.
|
Hey @rockfaith75 cool that you are still working on this, take all the time you need. I might be best reachable on the fslab discord server: https://discord.gg/k3kUtFY8DB |
@kMutagene this is what we ended up playing with during the hackaton, in meantime it is useful to people lurking. #r "nuget: Plotly.NET"
open Plotly.NET
open Plotly.NET.TraceObjects
let labelAndValues = [
"Child Care" , 44.8
"Public Transport", 27.2
"weather" , 19.6
"Traffic" , 56.
]
module Seq =
let unzip keyValues =
keyValues |> Seq.map fst
, keyValues |> Seq.map snd
type Chart with
static member Pareto(keysValues: seq<string * float>, ?Name: string, ?Label: string) =
let orderedLabels, orderedValues =
keysValues
|> Seq.sortByDescending snd
|> Seq.unzip
let sum = orderedValues |> Seq.sum
let topPaddingRatio = 0.05
let cumulativeSum =
Seq.scan (+) 0. orderedValues
|> Seq.skip 1
let paretoValues =
Seq.zip orderedLabels cumulativeSum
|> Seq.map (fun (label,value) -> label, value / sum * 100.)
let bars = Chart.Column(Seq.zip orderedLabels orderedValues,?Name=Name)
let points =
Chart.Point(
paretoValues
, ShowLegend = false
, Marker = Marker.init(Size = 8, Color = Color.fromKeyword Black, Symbol = StyleParam.MarkerSymbol.Cross, Angle = 45.)
)
|> Chart.withAxisAnchor (Y = 2)
let lines =
Chart.Line(
paretoValues
, Name = "Cumulative %"
, ShowLegend = true
)
|> Chart.withAxisAnchor (Y = 2)
[bars;lines;points]
|> Chart.combine
|> Chart.withYAxisStyle (
?TitleText = Label
, Id = StyleParam.SubPlotId.YAxis 1
, ShowGrid = false
, MinMax = (0.,sum * (1.+topPaddingRatio))
)
|> Chart.withYAxisStyle (
TitleText = "%"
, Side = StyleParam.Side.Right
, Id = StyleParam.SubPlotId.YAxis 2
, MinMax = (0.,100. * (1.+topPaddingRatio))
, Overlaying = StyleParam.LinearAxisId.Y 1
)
Chart.Pareto(labelAndValues, Name="Budget", Label="$") |> Chart.show I intend to work with @rockfaith75 in order to make a full fledged PR that will meet the bar for integration in the library. |
This has been merged 🥳 , thank you @smoothdeveloper and @rockfaith75 ! |
Description
Example:
Pointers
#IConvertible
for data input, as this allows forstring
s, number types such asint
andfloat
, andDateTime
.References
The text was updated successfully, but these errors were encountered: