plot 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/plot/mark.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a4c9cdff5e430e39848b1a600059bdc6bef528f2f7b8e0d845ff881106d5243
|
4
|
+
data.tar.gz: fa8897e7299c937e101d56be0b344003effc4982249ac1ce89ff41b20dcf7678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a99e59876e00212709b71de99dbf47f8cf4ea197576bbb8d7c8f2e3fad8660088c346462f163de0906039dc130bfff3304db0359d57c50fdecf4828a5773602
|
7
|
+
data.tar.gz: 80c74daa800b0a80b7235238c43e0a825943564c04522e89dcec6d80236baf64c2406df24f1247ca0d41d3a15fdcc4fa337759d8c3b3750718c2e73ceb64f21c
|
data/lib/plot/mark.rb
CHANGED
@@ -82,7 +82,18 @@ class Plot::Mark
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
|
85
|
+
data.each do |d|
|
86
|
+
d.each do |k,v|
|
87
|
+
if v.class == Date then
|
88
|
+
d[k] = {
|
89
|
+
date: true,
|
90
|
+
string: v.to_s
|
91
|
+
}
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
"Plot['#{@type}'](JSON.parse(`#{JSON.generate(data)}`).map((obj) => { Object.keys(obj).forEach((k) => { if (obj[k].date) { obj[k] = new Date(Date.parse(obj[k].string)) } } ); return obj; }), JSON.parse('#{JSON.generate(@options)}'))"
|
86
97
|
end
|
87
98
|
|
88
99
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reese Armstrong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An unofficial DSL for making charts with Observable Plot. You define
|
14
14
|
plot definitions with the DSL that create full charts when data is added. This gem
|