GenieFramework / GenieFramework/StippleUI.jl
WIP: Multi-handle slider / vue-slider-component / array transmission
- Dominant language
- Julia
- Stars
- 90
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
@essenciary
These days I had the need for a slider with multiple handles. After some search I landed with [vue-slider-component](https://github.com/NightCatSama/vue-slider-component) by @nightcatsama
It's a really nice component, but it is not part of the quasar library. Do you think it makes sense to include it nevertheless?
In this context I experienced two problems:
- The vue-slider-component emits an array of numbers when there are more than one handle, but only a normal number, in case of a single handle
- the parsed array is of type `Any`
This latter poses a general problem for Stipple. Typed arrays are not correctly handled by Stipple and the only way is to use arrays of type any.
I propose a solution along the following lines:
- typecast the Array elementwise
- check whether the julian receiving component is an array but the payload isn't, then make an array out of it
```
newval = if valtype <: Array && eltype(val) != Any
if typeof(payload["newval"]) <: Array
convert.(eltype(val), payload["newval"])
else
[convert(eltype(val), payload["newval"])]
end
else
# continue with the normal Base.parse ...
end
```
We could also hide this part in the Base.parse ...
What do you think?
P.S.: If there are more complex data types, such as plots it gets even more difficult. If you change a ploton the front end, Stipple spits errors, because the chart data are not correctly resolved to julian data types.
Solving this would be even more complicated. Perhaps you have an idea?
Of, course read-only types would help here...
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the issue's proposed Base.parse handling and how vue-slider-component sends single values versus arrays. Trace the StippleUI path that receives slider payloads and define tests for typed arrays, scalar-to-array conversion, and the unresolved plot-data case before deciding what is in scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100