January 2020
Intermediate to advanced
532 pages
13h 31m
English
AbstractPlotting.jl is an abstract plotting library that is part of the Makie plotting system. The source code for this library can be found at https://github.com/JuliaPlots/AbstractPlotting.jl.
Let's take a look at a trait that's related to data conversion:
abstract type ConversionTrait endstruct NoConversion <: ConversionTrait endstruct PointBased <: ConversionTrait endstruct SurfaceLike <: ConversionTrait end# By default, there is no conversion trait for any objectconversion_trait(::Type) = NoConversion()conversion_trait(::Type{<: XYBased}) = PointBased()conversion_trait(::Type{<: Union{Surface, Heatmap, Image}}) = SurfaceLike()
It defines a ConversionTrait that can be used for the convert_arguments ...
Read now
Unlock full access