GenieFramework / Stipple-Demo-GermanCredits

MIT License
4 stars 1 forks source link

DataFrames syntax #2

Open dvasya opened 3 years ago

dvasya commented 3 years ago

Patch to make the demo compatible with recent DataFrames versions:

59,62c59,62
<   model.big_numbers_count_good_credits[] = data[(data[:Good_Rating] .== true), [:Good_Rating]] |> nrow
<   model.big_numbers_count_bad_credits[] = data[(data[:Good_Rating] .== false), [:Good_Rating]] |> nrow
<   model.big_numbers_amount_good_credits[] = data[(data[:Good_Rating] .== true), [:Amount]] |> Array |> sum
<   model.big_numbers_amount_bad_credits[] = data[(data[:Good_Rating] .== false), [:Amount]] |> Array |> sum
---
>   model.big_numbers_count_good_credits[] = data[(data.Good_Rating .== true), [:Good_Rating]] |> nrow
>   model.big_numbers_count_bad_credits[] = data[(data.Good_Rating .== false), [:Good_Rating]] |> nrow
>   model.big_numbers_amount_good_credits[] = data[(data.Good_Rating .== true), [:Amount]] |> Array |> sum
>   model.big_numbers_amount_bad_credits[] = data[(data.Good_Rating .== false), [:Amount]] |> Array |> sum
70c70
<           data[(data[:Age] .∈ [x:x+10]) .& (data[:Good_Rating] .== true), [:Good_Rating]] |> nrow)
---
>           data[(data.Age .∈ [x:x+10]) .& (data.Good_Rating .== true), [:Good_Rating]] |> nrow)
72c72
<           data[(data[:Age] .∈ [x:x+10]) .& (data[:Good_Rating] .== false), [:Good_Rating]] |> nrow)
---
>           data[(data.Age .∈ [x:x+10]) .& (data.Good_Rating .== false), [:Good_Rating]] |> nrow)
83,84c83,84
<   credit_stats[:good_credit] = data[data[:Good_Rating] .== true, selected_columns]
<   credit_stats[:bad_credit] = data[data[:Good_Rating] .== false, selected_columns]
---
>   credit_stats[:good_credit] = data[data.Good_Rating .== true, selected_columns]
>   credit_stats[:bad_credit] = data[data.Good_Rating .== false, selected_columns]
108c108
<   model = setmodel(data[(model.range_data[].range.start .<= data[:Age] .<= model.range_data[].range.stop), :], model)
---
>   model = setmodel(data[(model.range_data[].range.start .<= data.Age .<= model.range_data[].range.stop), :], model)

Also the demo doesn't seem to work over WebSockets (port 9001) "Server never wrote a response", and the Y axis on the bubble chart isn't scaled correctly. Firefox 87 / Ubuntu x64

essenciary commented 3 years ago

Thanks - I think this repo should be removed, the demos have been collected at https://github.com/GenieFramework/StippleDemos But even there, the German Credits demo got broken in recent versions (eg the bubble chart)