@@ -7,7 +7,7 @@ import Makie as M
7
7
8
8
M. expand_dimensions (:: M.PointBased , y:: AbstractVector{<:UnionAbstractQuantity} ) = (keys (y), y)
9
9
M. create_dim_conversion (:: Type{<:UnionAbstractQuantity} ) = DQConversion ()
10
- M. MakieCore . should_dim_convert (:: Type{<:UnionAbstractQuantity} ) = true
10
+ M. should_dim_convert (:: Type{<:UnionAbstractQuantity} ) = true
11
11
12
12
unit_string (quantity:: UnionAbstractQuantity ) = string (dimension (quantity))
13
13
@@ -77,21 +77,18 @@ function M.get_ticks(conversion::DQConversion, ticks, scale, formatter, vmin, vm
77
77
return tick_vals, labels
78
78
end
79
79
80
- function M. convert_dim_observable (conversion:: DQConversion , value_obs:: M.Observable , deregister)
81
- # TODO : replace with update_extrema
80
+ function M. convert_dim_value (conversion:: DQConversion , attr, values, last_values)
82
81
if conversion. automatic_units
83
- conversion. quantity[] = oneunit (value_obs[][ 1 ] )
82
+ conversion. quantity[] = oneunit (first (values) )
84
83
end
85
- result = map (conversion. quantity, value_obs; ignore_equal_values= true ) do unit, values
86
- if ! isempty (values)
87
- # try if conversion works, to through error if not!
88
- # Is there a function for this to check in DynamicQuantities?
89
- unit_convert (unit, values[1 ])
90
- end
91
- return M. convert_dim_value (conversion, values)
84
+
85
+ unit = conversion. quantity[]
86
+ if ! isempty (values)
87
+ # try if conversion works, to through error if not!
88
+ # Is there a function for this to check in DynamicQuantities?
89
+ unit_convert (unit, first (values))
92
90
end
93
- append! (deregister, result. inputs)
94
- return result
91
+ return unit_convert (conversion. quantity[], values)
95
92
end
96
93
97
94
function M. convert_dim_value (conversion:: DQConversion , values)
109
106
using DynamicQuantities, Makie, Dates
110
107
const DQConversion = Base. get_extension (DynamicQuantities, :DynamicQuantitiesMakieExt ). DQConversion
111
108
112
- @recipe (DQPlot, x) do scene
113
- return Attributes ()
109
+ @recipe DQPlot (x, y) begin
114
110
end
115
111
116
112
function Makie. plot! (plot:: DQPlot )
0 commit comments