Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpetryk committed Feb 19, 2024
1 parent 2f12dfb commit 48d3f6c
Show file tree
Hide file tree
Showing 33 changed files with 26 additions and 100 deletions.
2 changes: 0 additions & 2 deletions docs/app/guides/custom-components/contexts/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import PizzaSlice from "guide-examples/custom/pizza-slice"
import PizzaSliceSource from "!raw-loader!guide-examples/custom/pizza-slice"

Expand Down
2 changes: 0 additions & 2 deletions docs/app/guides/custom-components/overview/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import PizzaMarch from "guide-examples/custom/pizza-march"

export default function CustomPage() {
Expand Down
2 changes: 0 additions & 2 deletions docs/app/guides/display/circles/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"use client"
import CodeAndExample from "components/CodeAndExample"

import MovableCircle from "guide-examples/MovableCircle"
import MovableCircleSource from "!raw-loader!guide-examples/MovableCircle"

import { PropTable } from "components/PropTable"
import { Circle } from "mafs"

export default function Page() {
return (
Expand Down
21 changes: 10 additions & 11 deletions docs/app/guides/display/coordinates/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use client"

import { Coordinates } from "mafs"
import { PropTable } from "components/PropTable"
import CodeAndExample from "components/CodeAndExample"

Check failure on line 2 in docs/app/guides/display/coordinates/page.tsx

View workflow job for this annotation

GitHub Actions / lint

'CodeAndExample' is defined but never used

import { Coordinates } from "mafs"

import CartesianCoordinatesExample from "guide-examples/display/coordinates/CartesianCoordinatesExample"

Check failure on line 6 in docs/app/guides/display/coordinates/page.tsx

View workflow job for this annotation

GitHub Actions / lint

'CartesianCoordinatesExample' is defined but never used
import CartesianCoordinatesExampleSource from "!raw-loader!guide-examples/display/coordinates/CartesianCoordinatesExample"

Check failure on line 7 in docs/app/guides/display/coordinates/page.tsx

View workflow job for this annotation

GitHub Actions / lint

'CartesianCoordinatesExampleSource' is defined but never used

Expand All @@ -27,12 +26,12 @@ function CoordinatesPage() {

<h2>Cartesian coordinates</h2>

<CodeAndExample
{/* <CodeAndExample
component={<CartesianCoordinatesExample />}
source={CartesianCoordinatesExampleSource}
/>
/> */}

<PropTable of={"Coordinates.Cartesian"} />
<PropTable of={Coordinates.Cartesian} />

<h3>Axis options</h3>

Expand Down Expand Up @@ -67,19 +66,19 @@ function CoordinatesPage() {
<code>labels</code> to render in terms of π.
</p>

<CodeAndExample
{/* <CodeAndExample
component={<CartesianCoordinatesConfigExample />}
source={CartesianCoordinatesConfigExampleSource}
/>
/> */}

<h2>Polar coordinates</h2>

<CodeAndExample
{/* <CodeAndExample
component={<PolarCoordinatesExample />}
source={PolarCoordinatesExampleSource}
/>
/> */}

<PropTable of={"Coordinates.Polar"} />
{/* <PropTable of={Coordinates.Polar} /> */}

<h3>Axis options</h3>

Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/debug/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"use client"

import Code from "components/Code"
import { PropTable } from "components/PropTable"
import { Debug } from "mafs"
import Link from "next/link"

import CodeAndExample from "components/CodeAndExample"
Expand Down
2 changes: 0 additions & 2 deletions docs/app/guides/display/ellipses/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"use client"
import CodeAndExample from "components/CodeAndExample"

import MovableEllipse from "guide-examples/MovableEllipse"
import MovableEllipseSource from "!raw-loader!guide-examples/MovableEllipse"
import WIP from "components/WIP"
import Link from "next/link"

import { Ellipse } from "mafs"
import { PropTable } from "components/PropTable"

export default function Page() {
Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/lines/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"use client"

import CodeAndExample from "components/CodeAndExample"
import { PropTable } from "components/PropTable"
import { Line } from "mafs"

import LineSegmentExample from "guide-examples/LineSegmentExample"
import LineSegmentExampleSource from "!raw-loader!guide-examples/LineSegmentExample"
Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/plots/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import CodeAndExample from "components/CodeAndExample"

import OfXAndY from "guide-examples/plots/of-x-and-y"
Expand All @@ -15,7 +13,6 @@ import SineStressTest from "guide-examples/plots/sine-stress-test"
import SineStressTestSource from "!raw-loader!guide-examples/plots/sine-stress-test.tsx"

import { PropTable } from "components/PropTable"
import { Plot } from "mafs"
import InequalitiesExample from "guide-examples/plots/inequalities"
import InequalitiesExampleSource from "!raw-loader!guide-examples/plots/inequalities.tsx"

Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/points/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
"use client"

import CodeAndExample from "components/CodeAndExample"

import SimplePoint from "guide-examples/display/SimplePoint"
import SimplePointSource from "!raw-loader!guide-examples/display/SimplePoint"

import { PropTable } from "components/PropTable"
import { Point } from "mafs"

function Points() {
return (
Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/polygons/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"use client"

import CodeAndExample from "components/CodeAndExample"

import PolygonExample from "guide-examples/PolygonExample"
import PolygonExampleSource from "!raw-loader!guide-examples/PolygonExample"
import PolylineExample from "guide-examples/PolylineExample"
import PolylineExampleSource from "!raw-loader!guide-examples/PolylineExample"
import { PropTable } from "components/PropTable"
import { Polygon, Polyline } from "mafs"

function Polygons() {
return (
Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/text/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"use client"

import { Text as T } from "mafs"
import CodeAndExample from "components/CodeAndExample"

import TextExample from "guide-examples/TextExample"
Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/transform/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"use client"

import SimpleTransformExample from "guide-examples/utility/SimpleTransform"
import SimpleTransformExampleSource from "!raw-loader!guide-examples/utility/SimpleTransform"
import CodeAndExample from "components/CodeAndExample"
import Code from "components/Code"
import { PropTable } from "components/PropTable"
import { Transform } from "mafs"

export default function Page() {
return (
Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/display/vectors/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"use client"

import { Vector } from "mafs"
import { PropTable } from "components/PropTable"

import CodeAndExample from "components/CodeAndExample"
Expand Down
5 changes: 2 additions & 3 deletions docs/app/guides/examples/bezier-curves/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
"use client"

import CodeAndExample from "components/CodeAndExample"
import BezierCurves from "guide-examples/examples/BezierCurves"
import BezierCurvesSource from "!raw-loader!guide-examples/examples/BezierCurves.tsx"
import Link from "next/link"

export default function BezierCurvesPage() {
return (
<>
<p>
This example was inspired by Freya Holmér's excellent{" "}
<a href="https://www.youtube.com/watch?v=aVwxzDHniEw">video on Bézier curves</a>.
<Link href="https://www.youtube.com/watch?v=aVwxzDHniEw">video on Bézier curves</Link>.
</p>

<CodeAndExample source={BezierCurvesSource} component={<BezierCurves />} />
Expand Down
2 changes: 0 additions & 2 deletions docs/app/guides/examples/fancy-parabola/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import CodeAndExample from "components/CodeAndExample"
import FancyParabola from "guide-examples/examples/FancyParabola"
import FancyParabolaSource from "!raw-loader!guide-examples/examples/FancyParabola.tsx"
Expand Down
2 changes: 0 additions & 2 deletions docs/app/guides/examples/projectile-motion/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import CodeAndExample from "components/CodeAndExample"
import ProjectileMotion from "guide-examples/examples/ProjectileMotion"
import ProjectileMotionSource from "!raw-loader!guide-examples/examples/ProjectileMotion.tsx"
Expand Down
2 changes: 0 additions & 2 deletions docs/app/guides/examples/riemann-sums/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import CodeAndExample from "components/CodeAndExample"
import Riemann from "guide-examples/examples/Riemann"
import RiemannSource from "!raw-loader!guide-examples/examples/Riemann.tsx"
Expand Down
2 changes: 0 additions & 2 deletions docs/app/guides/experimental/animation/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import WIP from "components/WIP"
import CodeAndExample from "components/CodeAndExample"

Expand Down
3 changes: 0 additions & 3 deletions docs/app/guides/experimental/latex/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"use client"
import CodeAndExample from "components/CodeAndExample"
import { PropTable } from "components/PropTable"

import { LaTeX } from "mafs"

import LatexExample from "components/guide-examples/display/Latex"
import LatexExampleSource from "!raw-loader!components/guide-examples/display/Latex"

Expand Down
17 changes: 0 additions & 17 deletions docs/app/guides/head.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/app/guides/interaction/movable-points/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"

import CodeAndExample from "components/CodeAndExample"

import PointsAlongFunction from "guide-examples/display/PointsAlongFunction"
Expand All @@ -11,7 +9,6 @@ import SnapPointSource from "!raw-loader!guide-examples/SnapPoint"
import { Advanced } from "components/Advanced"
import Code from "components/Code"
import Link from "next/link"
import { MovablePoint } from "mafs"
import { PropTable } from "components/PropTable"

function Stopwatch() {
Expand Down
8 changes: 0 additions & 8 deletions docs/app/guides/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import Link from "next/link"
import NextHead from "next/head"

import GuidesSidebar from "./sidebar"
import fancyFx from "../../helpers/fancyFx"
import ScrollTop from "components/ScrollTop"
import Head from "./head"
import { Title } from "./title"
import { NextPrevButtons } from "./next-prev-buttons"
import type { Metadata } from "next"
Expand All @@ -19,9 +14,6 @@ export const metadata: Metadata = {
export default function GuidesLayout({ children }: { children: React.ReactNode }) {
return (
<>
<NextHead>
<Head />
</NextHead>
<div className="max-w-5xl p-6 py-12 mx-auto md:flex space-y-6 md:space-y-0 md:space-x-6">
<div
className={`
Expand Down
9 changes: 3 additions & 6 deletions docs/components/PropTable.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use client"

import * as React from "react"
import * as Mafs from "mafs"
import ReactMarkdown from "react-markdown"
import { get } from "lodash"

export interface Docgen {
filePath: string
Expand All @@ -26,12 +24,11 @@ export type DocgenPropType =
| { name: string }

interface PropTableProps {
of: string
of: { displayName: string } | unknown
}

export function PropTable({ of: componentName }: PropTableProps) {
const component = get(Mafs, componentName)
const docgenInfo = (component as unknown as { __docgenInfo: Docgen })?.__docgenInfo
export function PropTable({ of: component }: PropTableProps) {
const docgenInfo = (component as { __docgenInfo: Docgen })?.__docgenInfo

if (process.env.NODE_ENV === "development" && docgenInfo == null) {
return (
Expand Down
2 changes: 1 addition & 1 deletion docs/components/guide-examples/PlainMafsExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import { Mafs, Text } from "mafs"

Expand Down
2 changes: 1 addition & 1 deletion docs/components/guide-examples/custom/pizza-march.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
Expand Down
2 changes: 1 addition & 1 deletion docs/components/guide-examples/custom/pizza-slice.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import { Mafs, Coordinates, Debug } from "mafs"
import * as React from "react"
Expand Down
2 changes: 1 addition & 1 deletion docs/components/guide-examples/custom/point-cloud.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import {
Coordinates,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import { Mafs, Coordinates, Debug } from "mafs"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import { Mafs, Coordinates, labelPi } from "mafs"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import { Mafs, Coordinates } from "mafs"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import { Mafs, Coordinates } from "mafs"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
"use client"

import { Mafs, Coordinates, Circle, Text } from "mafs"

Expand Down
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

export { Mafs } from "./view/Mafs"
export type { MafsProps } from "./view/Mafs"

Expand Down

0 comments on commit 48d3f6c

Please sign in to comment.