Reference
API¶
Every public function, generated from the code.
kh.bind¶
Compile a style against a table; colors and order fix category colours and their order.
kh.check_ramp¶
Lightness steps and colour-blind safety of a ramp, at the given number of classes.
kh.colors¶
Every Tailwind shade kharita knows, one family per row, with each shade's number.
kh.compare¶
Two or more kharita maps side by side; with link, they pan and zoom together.
kh.contours¶
kh.contours(where, interval=None, zoom=None, index_every=5, detail='medium', smooth=None, below_sea=False)
Contour lines over an area: a GeoDataFrame with elevation, index and weight columns.
where is a GeoDataFrame, GeoSeries or (west, south, east, north). Every index_every-th line is an index contour (weight 2, the rest 1), the thicker labelled line of a topographic map. detail is low, medium or high: how much small bumps and wiggles are kept. smooth sets the blur in metres directly; 0 turns generalisation off.
kh.define¶
Save a style under a name so it can be used as preset-<name>.
kh.explain¶
Show what a style compiles to and which token set each part.
kh.help¶
Print every utility, or the details and examples for one.
kh.imagery¶
Choose the imagery for basemap-satellite and basemap-hybrid.
source is a Sentinel-2 cloudless year (2016 is free for any use with credit; 2017 to 2024 are non-commercial only) or your own tile URL with {z}, {x} and {y}, such as a provider you hold a key for. Returns the imagery now in use.
kh.layer¶
Native Lonboard layers for a style: one per geometry type present.
kh.legend¶
The legend HTML for a style on its own, for use with your own Lonboard map.
kh.map¶
kh.map(gdf, style, legend=None, basemap=None, height=500, title=None, subtitle=None, source=None, colors=None, order=None, kicker=None, title_style=None, legend_style=None, shape=None, backdrop=None)
One GeoDataFrame, one style, one map; title, subtitle and source draw the title card.
kh.palette¶
Register your own ramp, then use it as ramp-<name>.
kh.parse¶
Compile a style string to a StyleSpec, raising StyleSyntaxError on any problem.
kh.ramps¶
Every ramp as a swatch strip; filter by kind, a word in the name, or source.
kh.theme¶
Register your own theme from a base theme and element colours, then use theme-<name>.
kh.utilities¶
Every utility kharita understands.
kh.validate¶
Parse a style and, if columns are given, check every referenced column exists.