Comments (5)
maybe with using the cgrad
method? https://docs.juliaplots.org/latest/generated/colorschemes/
from gigascatter.jl.
palette = cgrad(:viridis)
scale(x::Number,y::StepRangeLen) = ( x - minimum(y) )/( maximum(y) - minimum(y) )
color = map( x->palette[scale(x,channelRange)], fcsdata[!,channel] )
from gigascatter.jl.
Yes, this would help a lot. The scaling is now (partially) done by scaleMinMax
(see README examples). Perhaps the easiest way to have that working would be to supply kwargs min/max to the scaleMinMax
function that set the bounds properly. Would that work for you?
See https://github.com/LCSB-BioCore/GigaScatter.jl/blob/master/src/colors.jl#L114 for scaleMinMax.
I didn't know about cgrad, I guess I can replace a bit of the code with that, e.g. this https://github.com/LCSB-BioCore/GigaScatter.jl/blob/master/src/colors.jl#L28 .
from gigascatter.jl.
I realised that calling palette(::Float64)
is 10x slower than palette(::Int64)
and therefore it makes sense to pre-compute color indexes for each event. Here is the snippet I am working with:
channelRange, nlevels = range(-2,7,length=50), 10
palette = cgrad(:viridis,nlevels,categorical=true)
channels = names(fcsdata)
channel = Observable(first(channels))
function toIndex(x::AbstractVector{<:Number})
min,max = extrema(channelRange)
scaled = ( x .- min ) / ( max - min )
@. scaled[scaled<0] = 0
@. scaled[1<scaled] = 1
return @. trunc(Int,nlevels*scaled) + 1
end
colorIndex = combine(fcsdata,[ col => toIndex => col for col ∈ names(fcsdata) ] )
color = Observable(palette[ colorIndex[!,channel[]] ])
############################# update on channel change
on(channel) do channel
color[] = palette[ colorIndex[!,channel] ]
end
here color[]
is a Vector{RGBA{Float64}}
which is a good input for the color
kwarg in Makie.jl
. Is it also suitable for GigaScatter.jl
?
from gigascatter.jl.
the slowness is quite likely because the float version is doing the interpolation with all colors; I guess I can do the same with our ColorPalette. I'll likely get to it tomorrow.
from gigascatter.jl.
Related Issues (10)
- Create a proper documentation
- Bump version v0.1.2 HOT 1
- Bump version v0.1.3 HOT 2
- getTile(x,y,z) method for zoom-able maps HOT 7
- Bump version 0.1.4 HOT 3
- TagBot trigger issue HOT 3
- rasterize method is too restrictive on argument types HOT 4
- Bump v0.1.5 HOT 2
- new release fails to compile because both ImageCore and ImageAxes export ImageCore HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gigascatter.jl.