Equations
- ProofWidgets.Svg.instToJsonFrame = { toJson := ProofWidgets.Svg.toJsonFrame✝ }
Equations
- ProofWidgets.Svg.instFromJsonFrame = { fromJson? := ProofWidgets.Svg.fromJsonFrame✝ }
Instances For
Instances For
Instances For
Instances For
Equations
- ProofWidgets.Svg.instToJsonColor = { toJson := ProofWidgets.Svg.toJsonColor✝ }
Equations
- ProofWidgets.Svg.instFromJsonColor = { fromJson? := ProofWidgets.Svg.fromJsonColor✝ }
Returns string "rgb(r, g, b)" with r,g,b ∈ [0,...,256)
Equations
Instances For
- px {f : ProofWidgets.Svg.Frame} (i j : Int) : ProofWidgets.Svg.Point f
- abs {f : ProofWidgets.Svg.Frame} (x y : Float) : ProofWidgets.Svg.Point f
Instances For
Equations
- ProofWidgets.Svg.instInhabitedPoint = { default := ProofWidgets.Svg.Point.px default default }
Equations
- ProofWidgets.Svg.instToJsonPoint = { toJson := ProofWidgets.Svg.toJsonPoint✝ }
Equations
- ProofWidgets.Svg.instFromJsonPoint = { fromJson? := ProofWidgets.Svg.fromJsonPoint✝ }
instance
ProofWidgets.Svg.instCoeProdFloatPoint
(f : ProofWidgets.Svg.Frame)
:
Coe (Float × Float) (ProofWidgets.Svg.Point f)
Equations
- ProofWidgets.Svg.instCoeProdFloatPoint f = { coe := fun (x : Float × Float) => match x with | (x, y) => ProofWidgets.Svg.Point.abs x y }
instance
ProofWidgets.Svg.instCoeProdIntPoint
(f : ProofWidgets.Svg.Frame)
:
Coe (Int × Int) (ProofWidgets.Svg.Point f)
Equations
- ProofWidgets.Svg.instCoeProdIntPoint f = { coe := fun (x : Int × Int) => match x with | (i, j) => ProofWidgets.Svg.Point.px i j }
Equations
- (ProofWidgets.Svg.Point.px a a_1).toPixels = (a, a_1)
- (ProofWidgets.Svg.Point.abs a a_1).toPixels = (Float.toInt✝ ((a - f.xmin) / f.pixelSize).floor, Float.toInt✝ ((f.ymax - a_1) / f.pixelSize).floor)
Instances For
Equations
- (ProofWidgets.Svg.Point.abs x y).toAbsolute = (x, y)
- (ProofWidgets.Svg.Point.px i j).toAbsolute = (f.xmin + (Int.toFloat✝ i + 0.5) * f.pixelSize, f.ymax - (Int.toFloat✝ j + 0.5) * f.pixelSize)
Instances For
- px {f : ProofWidgets.Svg.Frame} (size : Nat) : ProofWidgets.Svg.Size f
- abs {f : ProofWidgets.Svg.Frame} (size : Float) : ProofWidgets.Svg.Size f
Instances For
Equations
- ProofWidgets.Svg.instToJsonSize = { toJson := ProofWidgets.Svg.toJsonSize✝ }
Equations
- ProofWidgets.Svg.instFromJsonSize = { fromJson? := ProofWidgets.Svg.fromJsonSize✝ }
Equations
- (ProofWidgets.Svg.Size.px a).toPixels = a
- (ProofWidgets.Svg.Size.abs a).toPixels = (a / f.pixelSize).ceil.toUInt64.toNat
Instances For
- line {f : ProofWidgets.Svg.Frame} (src trg : ProofWidgets.Svg.Point f) : ProofWidgets.Svg.Shape f
- circle {f : ProofWidgets.Svg.Frame} (center : ProofWidgets.Svg.Point f) (radius : ProofWidgets.Svg.Size f) : ProofWidgets.Svg.Shape f
- polyline {f : ProofWidgets.Svg.Frame} (points : Array (ProofWidgets.Svg.Point f)) : ProofWidgets.Svg.Shape f
- polygon {f : ProofWidgets.Svg.Frame} (points : Array (ProofWidgets.Svg.Point f)) : ProofWidgets.Svg.Shape f
Instances For
Equations
- ProofWidgets.Svg.instToJsonShape = { toJson := ProofWidgets.Svg.toJsonShape✝ }
Equations
- ProofWidgets.Svg.instFromJsonShape = { fromJson? := ProofWidgets.Svg.fromJsonShape✝ }
Equations
- One or more equations did not get rendered due to their size.
Instances For
- shape : ProofWidgets.Svg.Shape f
- strokeColor : Option ProofWidgets.Svg.Color
- strokeWidth : Option (ProofWidgets.Svg.Size f)
- fillColor : Option ProofWidgets.Svg.Color
Instances For
Equations
- ProofWidgets.Svg.instToJsonElement = { toJson := ProofWidgets.Svg.toJsonElement✝ }
Equations
- ProofWidgets.Svg.instFromJsonElement = { fromJson? := ProofWidgets.Svg.fromJsonElement✝ }
def
ProofWidgets.Svg.Element.setStroke
{f : ProofWidgets.Svg.Frame}
(elem : ProofWidgets.Svg.Element f)
(color : ProofWidgets.Svg.Color)
(width : ProofWidgets.Svg.Size f)
:
Equations
Instances For
def
ProofWidgets.Svg.Element.setFill
{f : ProofWidgets.Svg.Frame}
(elem : ProofWidgets.Svg.Element f)
(color : ProofWidgets.Svg.Color)
:
Equations
Instances For
def
ProofWidgets.Svg.Element.setId
{f : ProofWidgets.Svg.Frame}
(elem : ProofWidgets.Svg.Element f)
(id : String)
:
Equations
Instances For
def
ProofWidgets.Svg.Element.setData
{α : Type}
{f : ProofWidgets.Svg.Frame}
(elem : ProofWidgets.Svg.Element f)
(a : α)
[Lean.ToJson α]
:
Equations
- elem.setData a = { shape := elem.shape, strokeColor := elem.strokeColor, strokeWidth := elem.strokeWidth, fillColor := elem.fillColor, id := elem.id, data := some (Lean.toJson a) }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProofWidgets.Svg.line p q = { shape := ProofWidgets.Svg.Shape.line p q, strokeColor := none, strokeWidth := none, fillColor := none, id := none, data := none }
Instances For
def
ProofWidgets.Svg.circle
{f : ProofWidgets.Svg.Frame}
(c : ProofWidgets.Svg.Point f)
(r : ProofWidgets.Svg.Size f)
:
Equations
- ProofWidgets.Svg.circle c r = { shape := ProofWidgets.Svg.Shape.circle c r, strokeColor := none, strokeWidth := none, fillColor := none, id := none, data := none }
Instances For
def
ProofWidgets.Svg.polyline
{f : ProofWidgets.Svg.Frame}
(pts : Array (ProofWidgets.Svg.Point f))
:
Equations
- ProofWidgets.Svg.polyline pts = { shape := ProofWidgets.Svg.Shape.polyline pts, strokeColor := none, strokeWidth := none, fillColor := none, id := none, data := none }
Instances For
def
ProofWidgets.Svg.polygon
{f : ProofWidgets.Svg.Frame}
(pts : Array (ProofWidgets.Svg.Point f))
:
Equations
- ProofWidgets.Svg.polygon pts = { shape := ProofWidgets.Svg.Shape.polygon pts, strokeColor := none, strokeWidth := none, fillColor := none, id := none, data := none }
Instances For
def
ProofWidgets.mkIdToIdx
{f : ProofWidgets.Svg.Frame}
(elements : Array (ProofWidgets.Svg.Element f))
:
Std.HashMap String (Fin elements.size)
Equations
- One or more equations did not get rendered due to their size.
Instances For
- elements : Array (ProofWidgets.Svg.Element f)
- idToIdx : Std.HashMap String (Fin self.elements.size)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- svg.idToData = Std.HashMap.ofList svg.idToDataList
Instances For
instance
ProofWidgets.Svg.instGetElemNatElementLtSizeElements
{f : ProofWidgets.Svg.Frame}
:
GetElem (ProofWidgets.Svg f) Nat (ProofWidgets.Svg.Element f) fun (svg : ProofWidgets.Svg f) (idx : Nat) =>
idx < svg.elements.size
Equations
- ProofWidgets.Svg.instGetElemNatElementLtSizeElements = { getElem := fun (svg : ProofWidgets.Svg f) (i : Nat) (h : i < svg.elements.size) => svg.elements[i] }
instance
ProofWidgets.Svg.instGetElemStringOptionElementTrue
{f : ProofWidgets.Svg.Frame}
:
GetElem (ProofWidgets.Svg f) String (Option (ProofWidgets.Svg.Element f)) fun (x : ProofWidgets.Svg f) (x : String) =>
True
Equations
- One or more equations did not get rendered due to their size.
def
ProofWidgets.Svg.getData
{f : ProofWidgets.Svg.Frame}
(svg : ProofWidgets.Svg f)
(id : String)
: