Equations
- ProofWidgets.Svg.instToJsonFrame = { toJson := ProofWidgets.Svg.toJsonFrame✝ }
Equations
- ProofWidgets.Svg.instFromJsonFrame = { fromJson? := ProofWidgets.Svg.fromJsonFrame✝ }
Equations
- ProofWidgets.Svg.instToJsonColor = { toJson := ProofWidgets.Svg.toJsonColor✝ }
Equations
- ProofWidgets.Svg.instFromJsonColor = { fromJson? := ProofWidgets.Svg.fromJsonColor✝ }
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✝ }
Equations
- ProofWidgets.Svg.instCoeProdFloatPoint f = { coe := fun (x : Float × Float) => match x with | (x, y) => ProofWidgets.Svg.Point.abs x y }
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
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
Equations
- ProofWidgets.Svg.instToJsonShape = { toJson := ProofWidgets.Svg.toJsonShape✝ }
Equations
- ProofWidgets.Svg.instFromJsonShape = { fromJson? := ProofWidgets.Svg.fromJsonShape✝ }
Equations
Equations
- ProofWidgets.Svg.instFromJsonElement = { fromJson? := ProofWidgets.Svg.fromJsonElement✝ }
def
ProofWidgets.Svg.Element.setData
{α : Type}
{f : Frame}
(elem : Element f)
(a : α)
[Lean.ToJson α]
:
Element f
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
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
Equations
- ProofWidgets.Svg.polyline pts = { shape := ProofWidgets.Svg.Shape.polyline pts, strokeColor := none, strokeWidth := none, fillColor := none, id := none, data := none }
Instances For
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 : Svg.Frame}
(elements : Array (Svg.Element f))
:
Std.HashMap String (Fin elements.size)
Equations
- One or more equations did not get rendered due to their size.
Instances For
- 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
- svg.idToData = Std.HashMap.ofList svg.idToDataList
Instances For
Equations
- ProofWidgets.Svg.instGetElemNatElementLtSizeElements = { getElem := fun (svg : ProofWidgets.Svg f) (i : Nat) (h : i < svg.elements.size) => svg.elements[i] }