Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion calc-backend/graph-gen/graph-integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,14 @@ def generate_bars(n_bars):
barmode='overlay',
xaxis_title="x-axis",
yaxis_title="y-axis",
xaxis=dict(range=[a, b], fixedrange=True),
xaxis=dict(range=[a, b], fixedrange=True, showgrid=True),
yaxis=dict(fixedrange=True),
)

fig_json = fig.to_json(pretty=True)

print(fig_json)

# Uncomment to save the graph as HTML code to use in the frontend
# fig.write_html("graph.html", include_plotlyjs=False, full_html=False, div_id='integral-graph')

10 changes: 8 additions & 2 deletions calc-backend/graph-gen/graph-limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import numpy as np

# === USER DEFINES ONLY THESE TWO ===
func = lambda x: x**3 # ← your function
limit_x = 0 # ← point to approach
func = lambda x: np.log(x) # ← your function
limit_x = 2 # ← point to approach

# === Slider & sampling settings (fixed) ===
num_steps = 50
Expand Down Expand Up @@ -90,3 +90,9 @@ def segment(i):
)

fig.show()

fig_json = fig.to_json(pretty=True)

# Save to file
with open("limit-graph.txt", "a") as f:
f.write(fig_json)
30,624 changes: 15,309 additions & 15,315 deletions calc-frontend/public/lnLim.json

Large diffs are not rendered by default.

1,316 changes: 660 additions & 656 deletions calc-frontend/src/components/Cosine/IntCosineGraph.tsx

Large diffs are not rendered by default.

1,337 changes: 670 additions & 667 deletions calc-frontend/src/components/Cubic/IntCubicGraph.tsx

Large diffs are not rendered by default.

1,314 changes: 658 additions & 656 deletions calc-frontend/src/components/Euler/IntEulerGraph.tsx

Large diffs are not rendered by default.

1,313 changes: 658 additions & 655 deletions calc-frontend/src/components/Line/IntLineGraph.tsx

Large diffs are not rendered by default.

1,315 changes: 659 additions & 656 deletions calc-frontend/src/components/NatLog/IntNatLogGraph.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion calc-frontend/src/components/NatLog/NatLogLim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function NatLogLim() {
<div>
<div className="flex">
<div ref={container} className="center-header">
\lim_&#123;x\to1&#125;\ln(x)
\lim_&#123;x\to2&#125;\ln(x)
</div>
</div>

Expand Down
1,335 changes: 669 additions & 666 deletions calc-frontend/src/components/Quadratic/IntQuadraticGraph.tsx

Large diffs are not rendered by default.

1,315 changes: 659 additions & 656 deletions calc-frontend/src/components/Sine/IntSineGraph.tsx

Large diffs are not rendered by default.

1,304 changes: 653 additions & 651 deletions calc-frontend/src/components/Tangent/IntTangentGraph.tsx

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions calc-frontend/src/components/ui/VideoPlayer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

interface VideoPlayerProps {
videoUrl: string;
}

const VideoPlayer = ({ videoUrl }: VideoPlayerProps) => {
return (
<video
className="w-full aspect-video object-cover rounded-t-md"
src={videoUrl}
autoPlay
loop
muted
playsInline
/>
);
}

export default VideoPlayer;
38 changes: 7 additions & 31 deletions calc-frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import SignOutButton from "../components/ui/SignOutButton";
import derivativeVideo from '../animations/manim-videos/derivativeAnimation/1080p60/DerivativeAnimation.mp4';
import integralVideo from '../animations/manim-videos/integralAnimation/1080p60/RightRiemannSum.mp4';
import limitVideo from '../animations/manim-videos/limitsAnimation/1080p60/Limit.mp4';
import VideoPlayer from "../components/ui/VideoPlayer";

function Home() {
const {session, isPending} = useContext(AuthContext);

const d1 = useRef(null);
const d2 = useRef(null);
const d3 = useRef(null);
Expand Down Expand Up @@ -70,6 +71,7 @@ function Home() {
MQ.StaticMath(d26.current, { })
MQ.StaticMath(d27.current, { })
MQ.StaticMath(d28.current, { })

}, []);

return (
Expand All @@ -87,17 +89,10 @@ function Home() {


<div className="py-10 pt-[1.5rem] flex flex-col gap-6 m-auto home-list">

{/*Limits*/}
<div className="m-auto bg-white border-2 border-black-solid rounded-lg shadow-m">

<video
className="w-full object-cover rounded-t-md"
src={limitVideo}
autoPlay
loop
muted
playsInline
/>
<VideoPlayer videoUrl={limitVideo}/>

<div className="p-4 pt-2">
<h2 className="text-lg font-semibold">
Expand Down Expand Up @@ -151,11 +146,6 @@ function Home() {
</div>
</Link>

<Link to="/limits/custom" className = "link-box">
<div className="link-title2"><span ref={d25} style={{ cursor: 'pointer' }}>Custom</span>{/*Custom*/}
</div>
</Link>

<i className="fas fa-fire text-yellow-500 ml-2">
</i>
</div>
Expand All @@ -169,14 +159,7 @@ function Home() {
{/*Derivatives*/}
<div className="m-auto bg-white border-2 border-black-solid rounded-lg shadow-m">

<video
className="w-full object-cover rounded-t-md"
src={derivativeVideo}
autoPlay
loop
muted
playsInline
/>
<VideoPlayer videoUrl={derivativeVideo}/>

<div className="p-4 pt-2">
<h2 className="text-lg font-semibold">
Expand Down Expand Up @@ -250,14 +233,7 @@ function Home() {
{/*Integrals*/}
<div className="m-auto bg-white border-2 border-black-solid rounded-lg shadow-m">

<video
className="w-full object-cover rounded-t-md"
src={integralVideo}
autoPlay
loop
muted
playsInline
/>
<VideoPlayer videoUrl={integralVideo}/>

<div className="p-4 pt-2">
<h2 className="text-lg font-semibold">
Expand Down