This is an example from "Data Visualization with Python and Javascript" by Kyran Dale, O'Reilly, 2016. The goal was just to see how blocks work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Chapter 1 Section 1 | |
--- | |
\newcommand{\Z}{\mathbb{Z}} | |
\newcommand{\N}{\mathbb{N}} | |
\newcommand{\R}{\mathbb{R}} | |
\newcommand{\Q}{\mathbb{Q}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div = { | |
var div = html`` | |
var doc = new Bokeh.Document() ; | |
doc.add_root(P) ; | |
await Bokeh.embed.add_document_standalone(doc, div) | |
return div ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
P = { | |
var p = Bokeh.Plotting.figure({x_range: new Bokeh.FactorRange({factors: x, range_padding: 0.1}), | |
plot_height: 300, plot_width:800, toolbar_location: null, title: "Fruit Counts By Year"}) | |
p.vbar({x, top: counts, width:0.9}) ; | |
p.xaxis.map((axis) => axis.major_label_orientation = 1) ; | |
p.xgrid.map((grid) => grid.grid_line_color = null) ; | |
p.y_range_start = 0 ; | |
return p ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewof Bokeh = | |
{ | |
const ver = '2.0.2'; | |
const message = html`Loaded Bokeh Version ${ver}...` ; | |
if (!document.getElementById('bokehjs-css')) | |
document.head.appendChild( | |
html`<link id='bokehjs-css' | |
href='https://cdn.pydata.org/bokeh/release/bokeh-${ver}.min.css' | |
rel=stylesheet>`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# withdrawn pending further study! |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"directed": false, "multigraph": false, "graph": {}, "nodes": [{"bipartite": 1, "name": "Razaaq Adoti", "id": 1040389}, {"bipartite": 1, "name": "Tom Fisher", "id": 1024010}, {"bipartite": 1, "name": "Ronald Guttman", "id": 1007630}, {"bipartite": 1, "name": "Beverly D'Angelo", "id": 1040399}, {"bipartite": 1, "name": "H\u00e9ctor Elizondo", "id": 1024017}, {"bipartite": 1, "name": "Richard Bright", "id": 1015826}, {"bipartite": 1, "name": "Andre B. Blake", "id": 1007635}, {"bipartite": 1, "name": "George Buck Flower", "id": 1024020}, {"bipartite": 1, "name": "Chevy Chase", "id": 1007640}, {"bipartite": 1, "name": "Gary Oldman", "id": 1007642}, {"bipartite": 1, "name": "Matthew Cornwell", "id": 1032224}, {"bipartite": 1, "name": "Eileen Ryan", "id": 1040417}, {"bipartite": 1, "name": "Mia Farrow", "id": 1007648}, {"bipartite": 1, "name": "Donnie Wahlberg", "id": 1024033}, {"bipartite": 1, "name": "Richard Kiel", "id": 1024036}, {"bipartite": 1, "name": "Muse Watson", "id": 1007652}, {"bipartite": 1, "name": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class _nqueue(list): | |
"""A simple fixed length priority queue of tuples used by the vptree class to track | |
the closest points found so far. Contains pairs (dist, node) where node refers to the | |
vptree structure and dist is the distance from the given point to the corresponding node. | |
Only the smallest max_size examples are kept. | |
Does a simple append followed by sort, so is intended for short lists. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A | B | C | D | E | F | G | H | |
---|---|---|---|---|---|---|---|---|
28 | 55 | 43 | 91 | 81 | 53 | 19 | 87 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: bsd-3-clause |