From ab1794423c33531c50351c9299abce3b56e15878 Mon Sep 17 00:00:00 2001 From: Yash Raj Singh Date: Wed, 12 Feb 2025 22:00:44 +0100 Subject: [PATCH 1/3] added misc packages --- Project.toml | 2 ++ src/PlutoGrid.jl | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Project.toml b/Project.toml index 8e4ca8e..34bf11c 100644 --- a/Project.toml +++ b/Project.toml @@ -4,11 +4,13 @@ authors = ["Benjamin Lungwitz and contributors"] version = "0.1.2" [deps] +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" [compat] +CSV = "0.10.15" DataFrames = "1" HypertextLiteral = "0.9" Tables = "1" diff --git a/src/PlutoGrid.jl b/src/PlutoGrid.jl index ac6c868..ee248fb 100644 --- a/src/PlutoGrid.jl +++ b/src/PlutoGrid.jl @@ -4,6 +4,9 @@ using HypertextLiteral: @htl, JavaScript using Tables using DataFrames +##Custom packages required for the pluto notebook +using CSV + export readonly_table, editable_table, create_dataframe const MODIFIED_COL_INDICATOR = "modified_column_" From fcb7331e38dbfbb37aad261461eda6ad129fb81e Mon Sep 17 00:00:00 2001 From: Yash Raj Singh Date: Thu, 13 Feb 2025 00:18:02 +0100 Subject: [PATCH 2/3] imageRenderer function --- Project.toml | 2 ++ src/PlutoGrid.jl | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 34bf11c..1ad1fe2 100644 --- a/Project.toml +++ b/Project.toml @@ -7,12 +7,14 @@ version = "0.1.2" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" +JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" [compat] CSV = "0.10.15" DataFrames = "1" HypertextLiteral = "0.9" +JSON = "0.21.4" Tables = "1" julia = "1" diff --git a/src/PlutoGrid.jl b/src/PlutoGrid.jl index ee248fb..5ab1fa1 100644 --- a/src/PlutoGrid.jl +++ b/src/PlutoGrid.jl @@ -5,7 +5,7 @@ using Tables using DataFrames ##Custom packages required for the pluto notebook -using CSV +using CSV,JSON export readonly_table, editable_table, create_dataframe @@ -179,6 +179,10 @@ function numberParser(params) { return Number(params.newValue); }; +function imageRenderer(params){ + return ``; +}; + var div = currentScript.parentElement; // set default output value div.value = null; From 9f4540d4fc953c7619f3c009df1dc90eef95ec6c Mon Sep 17 00:00:00 2001 From: Yash Raj Singh Date: Tue, 18 Mar 2025 09:10:26 +0100 Subject: [PATCH 3/3] URI --- Project.toml | 2 ++ src/PlutoGrid.jl | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 1ad1fe2..cc505a5 100644 --- a/Project.toml +++ b/Project.toml @@ -9,6 +9,7 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" [compat] CSV = "0.10.15" @@ -16,6 +17,7 @@ DataFrames = "1" HypertextLiteral = "0.9" JSON = "0.21.4" Tables = "1" +URIs = "1.5.1" julia = "1" [extras] diff --git a/src/PlutoGrid.jl b/src/PlutoGrid.jl index 5ab1fa1..43da04c 100644 --- a/src/PlutoGrid.jl +++ b/src/PlutoGrid.jl @@ -5,7 +5,7 @@ using Tables using DataFrames ##Custom packages required for the pluto notebook -using CSV,JSON +using CSV, JSON, URIs export readonly_table, editable_table, create_dataframe @@ -179,9 +179,6 @@ function numberParser(params) { return Number(params.newValue); }; -function imageRenderer(params){ - return ``; -}; var div = currentScript.parentElement; // set default output value @@ -264,6 +261,11 @@ function _make_col_defs(df; filterable=true, editable_cols=String[]) col_dict["type"] = "numericColumn" filterable && (col_dict["filter"] = "agNumberColumnFilter") col_is_editable && (col_dict["valueParser"] = JavaScript("numberParser")) + + elseif eltype(df[!, c]) <: URI + col_dict["cellRenderer"] = JavaScript(raw"""params => { + return ``; + }""") end # ToDo: add type / filter for dates