forked from microbit-foundation/cctd-ml-machine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add graph line settings to aid accessibility (#548)
* Use foundation fork of Smoothie to support line style * Add graph line style settings * Add graph line thickness setting * Add preview graph to settings dialog --------- Co-authored-by: Matt Hillsdon <[email protected]>
- Loading branch information
1 parent
ff7c692
commit 4af9ec3
Showing
11 changed files
with
274 additions
and
29 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useMemo } from "react"; | ||
import { GraphLineScheme } from "../settings"; | ||
|
||
export interface GraphLineStyles { | ||
x: undefined | number[]; | ||
y: undefined | number[]; | ||
z: undefined | number[]; | ||
} | ||
|
||
export const useGraphLineStyles = ( | ||
graphLineScheme: GraphLineScheme | ||
): GraphLineStyles => { | ||
return useMemo(() => { | ||
switch (graphLineScheme) { | ||
case "accessible": { | ||
return { | ||
x: undefined, | ||
y: [10, 5], | ||
z: [2, 2], | ||
}; | ||
} | ||
default: { | ||
return { | ||
x: undefined, | ||
y: undefined, | ||
z: undefined, | ||
}; | ||
} | ||
} | ||
}, [graphLineScheme]); | ||
}; |
Oops, something went wrong.