diff --git a/README.md b/README.md
index 6f5bbfd..1ce220d 100644
--- a/README.md
+++ b/README.md
@@ -9,10 +9,8 @@
This Project is for the TU-Berlin Course "Julia Programming for Machine Learning"
Please make sure, that Julia `1.10` is used!
-This Module will return you a nice Scene you can use to display your Data with [Parallel Coordinates](https://en.wikipedia.org/wiki/Parallel_coordinates)
-
-
-_This Module was created with PkgTemplates.jl_
+This Module will return you a nice Makie Plot you can use to display your Data with [Parallel Coordinates](https://en.wikipedia.org/wiki/Parallel_coordinates)
+
## Getting Started
@@ -30,7 +28,6 @@ using ParallelPlots
| Parameter | Default | Example | Description |
|-------------------|----------|------------------------------------|------------------------------------------------------------------------------------------------------------------------|
-| normalize::Bool | false | normalize=true | If the Data should be normalized (min/max) |
| title::String | "" | title="My Title" | The Title of The Figure, |
| colormap | :viridis | colormap=:thermal | The Colors of the [Lines](https://docs.makie.org/dev/explanations/colors) |
| color_feature | nothing | color_feature="weight" | The Color of the Lines will be based on the values of this selected feature. If nothing, the last feature will be used |
@@ -46,10 +43,6 @@ julia> using ParallelPlots
julia> parallelplot(DataFrame(height=160:180,weight=60:80,age=20:40))
```
```
-# If you want to normalize the Data, you can add the value normalized=true, default is false
-julia> parallelplot(DataFrame(height=160:180,weight=reverse(60:80),age=20:40),normalize=true)
-```
-```
# If you want to set the size of the plot (default width:800, height:600)
julia> parallelplot( DataFrame(height=160:180,weight=60:80,age=20:40), figure = (resolution = (300, 300),) )
```
@@ -69,7 +62,7 @@ julia> parallelplot(DataFrame(height=160:180,weight=reverse(60:80),age=20:40), f
```
# Adjust Color and and feature
parallelplot(df,
- # You choose which axis/feature should be in charge for the coloring
+ # You choose which axis/feature should be in charge for the coloring
color_feature="weight",
# you can as well select, which Axis should be shown
feature_selection=["height","age","income"],
@@ -84,8 +77,6 @@ parallelplot(df,
)
```
-Please read the [Docs](/docs/build/index.html) for further Information
-
### Working on ParallelPlots / Cheatsheet
1. Using ParallelPlots
* Moving to the project folder
diff --git a/src/ParallelPlots.jl b/src/ParallelPlots.jl
index ea617d2..418b53d 100644
--- a/src/ParallelPlots.jl
+++ b/src/ParallelPlots.jl
@@ -5,16 +5,6 @@ using DataFrames: DataFrame, names, eachcol, size, minimum, maximum
-function normalize_DF(data::DataFrame)
- for col in names(data)
- data[!, col] = (data[!, col] .- minimum(data[!, col])) ./
- (maximum(data[!, col]) - minimum(data[!, col]))
- end
-
- return data
-end
-
-
function input_data_check(data::DataFrame)
if isnothing(data)
throw(ArgumentError("Data cannot be nothing"))
@@ -36,14 +26,13 @@ end
# Constructors
```julia
-ParallelPlot(data::DataFrame; normalize::Bool=false)
+ParallelPlot(data::DataFrame, _Arguments_)
```
# Arguments
| Parameter | Default | Example | Description |
|-------------------|----------|------------------------------------|------------------------------------------------------------------------------------------------------------------------|
-| normalize::Bool | false | normalize=true | If the Data should be normalized (min/max) |
| title::String | "" | title="My Title" | The Title of The Figure, |
| colormap | :viridis | colormap=:thermal | The Colors of the [Lines](https://docs.makie.org/dev/explanations/colors) |
| color_feature | nothing | color_feature="weight" | The Color of the Lines will be based on the values of this selected feature. If nothing, the last feature will be used |
@@ -58,9 +47,6 @@ ParallelPlot(data::DataFrame; normalize::Bool=false)
julia> using ParallelPlots
julia> parallelplot(DataFrame(height=160:180,weight=60:80,age=20:40))
-# If you want to normalize the Data, you can add the value normalized=true, default is false
-julia> parallelplot(DataFrame(height=160:180,weight=reverse(60:80),age=20:40),normalize=true)
-
# If you want to set the size of the plot
julia> parallelplot( DataFrame(height=160:180,weight=60:80,age=20:40), figure = (resolution = (300, 300),) )
@@ -95,7 +81,6 @@ parallelplot(df,
@recipe(ParallelPlot, df) do scene
Attributes(
# additional attributes
- normalize = false,
title = "", # Title of the Figure
colormap = :viridis, # https://docs.makie.org/dev/explanations/colors
color_feature = nothing, # Which feature to use for coloring (column name)
@@ -117,11 +102,6 @@ function Makie.plot!(pp::ParallelPlot)
# check the given DataFrame
input_data_check(data)
- # Normalize the data if required
- if pp.normalize[]
- data = normalize_DF(data)
- end
-
# Get the Fig and empty it, so its nice and clean for the next itaration
fig = current_figure()
empty!(fig)
@@ -237,7 +217,7 @@ function Makie.plot!(pp::ParallelPlot)
# add listener to Observable Arguments and trigger an update on change
# loop thorough the given Arguments
for kw in pp.kw
- # e.g. normalize
+ # e.g. curve
attribute_key = kw[1]
on(pp[attribute_key]) do x
# trigger update
diff --git a/test/runtests.jl b/test/runtests.jl
index 78ea12c..20284a4 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -4,7 +4,6 @@ include("test_argument_errors.jl")
include("test_curved.jl")
include("test_call_with_color_feature.jl")
include("test_call_with_feature_labels.jl")
-include("test_call_with_normalize.jl")
include("test_custom_dimensions.jl")
include("test_default_call.jl")
include("test_recipe_observable.jl")
diff --git a/test/test_call_with_normalize.jl b/test/test_call_with_normalize.jl
deleted file mode 100644
index 2132cbd..0000000
--- a/test/test_call_with_normalize.jl
+++ /dev/null
@@ -1,17 +0,0 @@
-using ParallelPlots: parallelplot
-using Test: @testset, @test
-using CairoMakie: save
-
-@testset "call with normalize" begin
-
- # Generate sample multivariate data
- df = create_person_df()
-
- #display
- fig = parallelplot(df, normalize=true; title="Normalize")
-
- @test fig !== nothing
-
- save("parallel_coordinates_plot_normalized.png", fig)
-
-end
\ No newline at end of file
diff --git a/test/test_recipe_observable.jl b/test/test_recipe_observable.jl
index 93cc8df..4810469 100644
--- a/test/test_recipe_observable.jl
+++ b/test/test_recipe_observable.jl
@@ -5,13 +5,12 @@ using Test: @testset
@testset "Use a Observable DataFrame" begin
# create the Data
- df_observable = Observable(create_person_df(2))
+ df_observable = Observable(create_person_df(3))
title_observable = Observable("")
- normalize_observable = Observable(true)
curve_observable = Observable(true)
# create the Plot
- fig, ax, sc = parallelplot(df_observable, normalize=normalize_observable, title=title_observable, curve = curve_observable)
+ fig, ax, sc = parallelplot(df_observable, title=title_observable, curve = curve_observable)
save("pcp_initialized.png", fig)
# we can change a parameter and the graph will be automaticly changed
@@ -24,15 +23,13 @@ using Test: @testset
# Update Dataframe
if(iseven(t))
- normalize_observable[] = false
curve_observable[] = false
title_observable[] = ""
df_observable[] = create_person_df(5)
else
- normalize_observable[] = true
curve_observable[] = true
- title_observable[] = "Normalize"
- df_observable[] = create_car_df(t)
+ title_observable[] = "Curved"
+ df_observable[] = create_car_df(t+1)
end