-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulator #995
Conversation
Deploying with Cloudflare Pages
|
# Conflicts: # src/libs/routing/pathnames.ts # src/libs/routing/routes.tsx
Added the simulator task #1002 |
@pingustar I see many chart related components under /lib and I'm not sure why they are there and not alongside the usual components |
|
Co-authored-by: François <francois.guezengar@hotmail.fr>
return; | ||
} | ||
|
||
wait(3000).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing this is the part that waits 3 seconds to start the animation - but an anonymous arrow function with an hardcoded number isn't a good way to help me understand it. I'd suggest a named function and a named constant for both
export const SimulatorPage = () => { | ||
const { simDisclaimerLastSeen, setSimDisclaimerLastSeen } = useStore(); | ||
const [timeRange] = useState({ | ||
start: dayjs().unix() - 60 * 60 * 24 * 30 * 12, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dayjs().subtract(1, 'year').unix()
useEffect(() => { | ||
if ( | ||
!!simDisclaimerLastSeen && | ||
simDisclaimerLastSeen > dayjs().unix() - 15 * 60 * 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you are making a mistake - daysjs unix is in seconds. I assume you want 15 minutes. not 15,000 :)
Please do this:
dayjs().subtract(15, 'minute').unix()
? 'Please add Sell and/or Buy budgets' | ||
: null; | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be generalized to a useDisclaimer custom hook which removes all this logic from the page
#1002
comment from @GrandSchtroumpf
I found this snippet that used D3 to animate an SVG, capture all frame to draw it on a canvas and use Media Recording API to export the result as an WebM video.
https://gist.github.com/miklobit/f777577d54b97f0dd234442ad9de8f60
Maybe you can use Region Capture to get the SVG stream directly
https://developer.chrome.com/docs/web-platform/region-capture?hl=en#region-capture