For zontinuous data such as time series, a streamgraph can be used in place of stacked bars. This example also demonstrates path transitions to interpolate between different layouts. Streamgraph algorithm, colors, and data generation inspired by Byron and Wattenberg.
This file contains hidden or 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
// Regular commander.js logic up here. None of this | |
// logic is run if a subcommand match was found | |
var knownSubCommands = [ | |
"blah", | |
"ha", | |
"etc" | |
] |
Elm has well thought out versioning rules. Because of Elm's strong type system their package manager could (can?) enforce the rules. They already have a CLI command to generate a report of what's changed between any two versions of a module.
For example, to compare changes between elm-lang/core's module 3.0.0 vs 4.0.0, run: elm-package diff elm-lang/core 3.0.0 4.0.0
which will produce:
Comparing elm-lang/core 3.0.0 to 4.0.0...
This is a MAJOR change.
------ Added modules - MINOR ------
This file contains hidden or 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
function test(){ | |
const a = "a"; | |
} |
This file contains hidden or 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 appActor from '../state/actors/app'; | |
import { useGesture } from '@use-gesture/react' | |
import { useEffect, useRef } from "react" | |
import { getCamera } from "../cameras/usePanZoom"; | |
export function usePanZoomEvents() { | |
const panZoomStartPositionInWorldSpace = useRef() | |
console.log("usepanzoom"); |
This file contains hidden or 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
function logSVG(svg){ | |
// Get svg data | |
var xml = new XMLSerializer().serializeToString(svg); | |
// Make it base64 | |
var svg64 = btoa(xml); | |
var b64Start = 'data:image/svg+xml;base64,'; | |
// Prepend a "header" | |
var image64 = b64Start + svg64; |
Here's the conversation I had collaborating with ChatGPT to build a basic diagramming app.
- Canvas based rendering
- You can create rectangles (click to create a rectangle)
- You can move rectangles (click on Move Rectangle)
- You can change the fill color of rectangles (Click on Change Color, then click on a rectangle to randomly assign it a fill color)
This file contains hidden or 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
// See VideoDecoder.configure for documentation on all configuration fields: | |
// https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/configure | |
type AvcCData = { | |
configurationVersion: number; | |
profileIndication: number; | |
profileCompatibility: number; | |
avcLevelIndication: number; | |
lengthSizeMinusOne: number; | |
sps: Uint8Array[]; |
This file contains hidden or 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
socket.on("server-text-to-speech") {data, ack in | |
print("server-text-to-speech") | |
// The data structure for this message type is here: | |
// https://github.com/descriptinc/descript-web-v2/blob/staging/pkg-js/brain-buddy-protocol/src/ServerSentEvents.ts#L27-L48 | |
if let firstItem = data.first as? [String: Any], | |
guard let progress = firstItem["progress"] as? String else { | |
return | |
} | |