✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.
improve page performance
AykutSaracc3bc79bc9794
diff --git a/public/assets/diagram_bg.webp b/public/assets/diagram_bg.webpnew file mode 100644index 00000000..5c3abf56Binary files /dev/null and b/public/assets/diagram_bg.webp differdiff --git a/public/assets/download_image.png b/public/assets/download_image.pngdeleted file mode 100644index 914148a5..00000000Binary files a/public/assets/download_image.png and /dev/null differdiff --git a/public/assets/download_image.webp b/public/assets/download_image.webpnew file mode 100644index 00000000..b07d29e1Binary files /dev/null and b/public/assets/download_image.webp differdiff --git a/src/components/PreviewDiagram/index.tsx b/src/components/PreviewDiagram/index.tsxdeleted file mode 100644index 86cf767b..00000000--- a/src/components/PreviewDiagram/index.tsx+++ /dev/null@@ -1,423 +0,0 @@-import React from "react";-import { ThemeProvider } from "styled-components";-import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";-import { Canvas } from "reaflow";-import { darkTheme } from "src/constants/theme";-import { CustomNode } from "../CustomNode";--const data = {- nodes: [- {- id: "1",- text: [- ["squadName", "Super hero squad"],- ["homeTown", "Metro City"],- ["formed", 2016],- ["secretBase", "Super tower"],- ["active", true],- ],- width: 233,- height: 113,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}",- },- {- id: "2",- text: "members",- width: 174,- height: 39,- data: {- type: "array",- isParent: true,- isEmpty: false,- childrenCount: 3,- },- path: "{Root}.members",- },- {- id: "3",- text: [- ["name", "Molecule Man"],- ["age", 29],- ["secretIdentity", "Dan Jukes"],- ],- width: 218,- height: 76,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[0]",- },- {- id: "4",- text: "powers",- width: 167,- height: 39,- data: {- type: "array",- isParent: true,- isEmpty: false,- childrenCount: 3,- },- path: "{Root}.members[0].powers",- },- {- id: "5",- text: "Radiation resistance",- width: 168,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[0].powers[0]",- },- {- id: "6",- text: "Turning tiny",- width: 110,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[0].powers[1]",- },- {- id: "7",- text: "Radiation blast",- width: 132,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[0].powers[2]",- },- {- id: "8",- text: [- ["name", "Madame Uppercut"],- ["age", 39],- ["secretIdentity", "Jane Wilson"],- ],- width: 233,- height: 76,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[1]",- },- {- id: "9",- text: "powers",- width: 167,- height: 39,- data: {- type: "array",- isParent: true,- isEmpty: false,- childrenCount: 3,- },- path: "{Root}.members[1].powers",- },- {- id: "10",- text: "Million tonne punch",- width: 161,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[1].powers[0]",- },- {- id: "11",- text: "Damage resistance",- width: 146,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[1].powers[1]",- },- {- id: "12",- text: "Superhuman reflexes",- width: 161,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[1].powers[2]",- },- {- id: "13",- text: [- ["name", "Eternal Flame"],- ["age", 1000000],- ["secretIdentity", "Unknown"],- ],- width: 204,- height: 76,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[2]",- },- {- id: "14",- text: "powers",- width: 167,- height: 39,- data: {- type: "array",- isParent: true,- isEmpty: false,- childrenCount: 5,- },- path: "{Root}.members[2].powers",- },- {- id: "15",- text: "Immortality",- width: 103,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[2].powers[0]",- },- {- id: "16",- text: "Heat Immunity",- width: 118,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[2].powers[1]",- },- {- id: "17",- text: "Inferno",- width: 74,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[2].powers[2]",- },- {- id: "18",- text: "Teleportation",- width: 118,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[2].powers[3]",- },- {- id: "19",- text: "Interdimensional travel",- width: 190,- height: 39,- data: {- type: "null",- isParent: false,- isEmpty: false,- childrenCount: 0,- },- path: "{Root}.members[2].powers[4]",- },- ],- edges: [- {- id: "e1-2",- from: "1",- to: "2",- },- {- id: "e2-3",- from: "2",- to: "3",- },- {- id: "e3-4",- from: "3",- to: "4",- },- {- id: "e4-5",- from: "4",- to: "5",- },- {- id: "e4-6",- from: "4",- to: "6",- },- {- id: "e4-7",- from: "4",- to: "7",- },- {- id: "e2-8",- from: "2",- to: "8",- },- {- id: "e8-9",- from: "8",- to: "9",- },- {- id: "e9-10",- from: "9",- to: "10",- },- {- id: "e9-11",- from: "9",- to: "11",- },- {- id: "e9-12",- from: "9",- to: "12",- },- {- id: "e2-13",- from: "2",- to: "13",- },- {- id: "e13-14",- from: "13",- to: "14",- },- {- id: "e14-15",- from: "14",- to: "15",- },- {- id: "e14-16",- from: "14",- to: "16",- },- {- id: "e14-17",- from: "14",- to: "17",- },- {- id: "e14-18",- from: "14",- to: "18",- },- {- id: "e14-19",- from: "14",- to: "19",- },- ],-};--const PreviewDiagram = () => {- const [paneWidth, setPaneWidth] = React.useState(0);- const [paneHeight, setPaneHeight] = React.useState(0);-- React.useEffect(() => {- const container = document.querySelector("#hero-section") as HTMLDivElement;-- if (container) {- const rects = container.getBoundingClientRect();- setPaneWidth(rects.width);- setPaneHeight(rects.height);- }- }, []);-- return (- <ThemeProvider theme={darkTheme}>- <TransformWrapper- maxScale={2}- minScale={0.05}- initialScale={1}- wheel={{ step: 0.04 }}- doubleClick={{ disabled: true }}- disabled- >- <TransformComponent- wrapperStyle={{- width: "100%",- height: "100%",- overflow: "visible",- }}- >- <Canvas- nodes={data.nodes}- edges={data.edges}- maxHeight={paneHeight}- maxWidth={paneWidth}- height={paneHeight}- width={paneWidth}- direction="RIGHT"- node={props => <CustomNode {...props} />}- pannable={false}- zoomable={false}- readonly={true}- dragEdge={null}- dragNode={null}- fit={true}- />- </TransformComponent>- </TransformWrapper>- </ThemeProvider>- );-};--export default PreviewDiagram;diff --git a/src/layout/Loading/index.tsx b/src/layout/Loading/index.tsxindex 186aace2..5f3a615b 100644--- a/src/layout/Loading/index.tsx+++ b/src/layout/Loading/index.tsx@@ -40,10 +40,6 @@ const StyledLoading = styled.div<{ visible: boolean }>`}`;-const StyledText = styled.span`- color: #faa81a;-`;-const StyledMessage = styled.div`color: #b9bbbe;font-size: 1.5rem;diff --git a/src/layout/Navbar/index.tsx b/src/layout/Navbar/index.tsxindex 1c4c96f0..059612a1 100644--- a/src/layout/Navbar/index.tsx+++ b/src/layout/Navbar/index.tsx@@ -87,7 +87,7 @@ export const Navbar = () => {Star us on GitHub</Button><Link href="/sign-in">- <Button variant="light" radius="md">+ <Button variant="light" radius="md" className="hide-mobile">Sign In</Button></Link>diff --git a/src/pages/index.tsx b/src/pages/index.tsxindex df798ef6..41cb4b7c 100644--- a/src/pages/index.tsx+++ b/src/pages/index.tsx@@ -1,5 +1,4 @@import React from "react";-import dynamic from "next/dynamic";import Head from "next/head";import Link from "next/link";import styled, { ThemeProvider } from "styled-components";@@ -9,8 +8,8 @@ import {Center,Container,Flex,- Group,Image,+ Group,Stack,Text,Title,@@ -23,14 +22,9 @@ import { lightTheme } from "src/constants/theme";import { Footer } from "src/layout/Footer";import { Navbar } from "src/layout/Navbar";-const PreviewDiagram = dynamic(() => import("src/components/PreviewDiagram"), {- ssr: false,-});-const StyledHome = styled.div``;const StyledHeroSection = styled.div`- min-height: 80vh;--bg-color: ${({ theme }) => theme.GRID_BG_COLOR};--line-color-1: ${({ theme }) => theme.GRID_COLOR_PRIMARY};--line-color-2: ${({ theme }) => theme.GRID_COLOR_SECONDARY};@@ -57,6 +51,7 @@ const StyledHeroSectionBody = styled.div`overflow: hidden;backdrop-filter: blur(1px);-webkit-backdrop-filter: blur(1px);+ min-height: 60vh;@media only screen and (max-width: 1200px) {flex-direction: column;@@ -91,9 +86,15 @@ const Left = styled.div`const Right = styled.div`position: absolute;- width: 60%;+ transform: translate(25%, 25%);+ width: 80%;right: 0;- filter: blur(1.2px);+ filter: blur(1px);+ user-select: none;++ @media only screen and (max-width: 600px) {+ display: none;+ }`;const StyledHighlightedText = styled.span`@@ -122,6 +123,11 @@ const StyledStatsWrapper = styled.div`const StyledFeatures = styled(Container)`.mantine-Image-root {filter: drop-shadow(3px 3px 5px black);++ img {+ width: 100%;+ object-fit: contain;+ }}@media only screen and (max-width: 735px) {@@ -131,24 +137,6 @@ const StyledFeatures = styled(Container)`}`;-// const PostCard: React.FC<{ avatar: string; content: string; name: string; handle: string }> = ({-// avatar,-// content,-// name,-// handle,-// }) => (-// <Paper p="sm" radius="lg" w={350} h={200} withBorder>-// <Flex align="center" gap="sm">-// <Avatar radius="lg" src={avatar} />-// <Stack spacing="0">-// <Text fw="bold">{name}</Text>-// <Text color="dimmed">@{handle}</Text>-// </Stack>-// </Flex>-// <Text mt="lg">{content}</Text>-// </Paper>-// );-export const HomePage = () => {return (<ThemeProvider theme={lightTheme}>@@ -203,7 +191,7 @@ export const HomePage = () => {</Group></Left><Right>- <PreviewDiagram />+ <Image src="/assets/diagram_bg.webp" width="1200" height="593" alt="diagram" /></Right></StyledHeroSectionBody></StyledHeroSection>@@ -248,7 +236,12 @@ export const HomePage = () => {<StyledFeatures my={60}><Flex py="lg" align="flex-start" gap="lg">- <Image width={500} src="/assets/highlight_graph.svg" alt="search through graph" />+ <Image+ width={500}+ height={287}+ src="/assets/highlight_graph.svg"+ alt="search through graph"+ /><Stack pt="lg"><Text color="dark" fz="1.5rem" fw="bold">ADVANCED GRAPH SEARCH@@ -260,7 +253,12 @@ export const HomePage = () => {</Stack></Flex><Flex py="lg" align="center" gap="lg" direction="row-reverse">- <Image width={300} src="/assets/multidata.png" alt="multiple format support" />+ <Image+ width={300}+ height={260}+ src="/assets/multidata.png"+ alt="multiple format support"+ /><Stack><Text color="dark" fz="1.5rem" fw="bold">DYNAMIC DATA VISUALIZATION@@ -273,7 +271,12 @@ export const HomePage = () => {</Stack></Flex><Flex py="lg" align="center" gap="lg">- <Image width={400} src="/assets/download_image.png" alt="download as image" />+ <Image+ width={400}+ height={344}+ src="/assets/download_image.webp"+ alt="download as image"+ /><Stack><Text color="dark" fz="1.5rem" fw="bold">DOWNLOAD AS IMAGE@@ -286,7 +289,7 @@ export const HomePage = () => {</Stack></Flex><Flex direction="row-reverse" py="lg" align="flex-start" gap="lg">- <Image width={500} src="/assets/preview_image.svg" alt="preview images" />+ <Image width={500} height={285} src="/assets/preview_image.svg" alt="preview images" /><Stack pt="lg"><Text color="dark" fz="1.5rem" fw="bold">IMAGE PREVIEW@@ -298,38 +301,6 @@ export const HomePage = () => {</Stack></Flex></StyledFeatures>- {/* <Container mt="lg">- <Title color="dark" order={2}>- What does the people say about JSON Crack?- </Title>- <Flex py={40} justify="center" gap="lg" wrap="wrap">- <PostCard- name="Alex Xu"- handle="alexxubyte"- avatar="https://media.licdn.com/dms/image/C5603AQEReSODdvboJw/profile-displayphoto-shrink_800_800/0/1633380703911?e=1692230400&v=beta&t=gjXipAUNUFzU47aMNrWiPC1ZP2H4oUaCNpDtJw6Wshs"- content="A very handy tool for converting nested JSON files into graph diagrams."- />- <PostCard- name="GitHub"- handle="github"- avatar="https://pbs.twimg.com/profile_images/1633247750010830848/8zfRrYjA_400x400.png"- content="Looking to understand or explore some JSON? Just paste or upload to visualize it as a graph with https://jsonvisio.com 😍 Thanks to @aykutsarach!"- />- <PostCard- name="GitHub"- handle="github"- avatar="https://pbs.twimg.com/profile_images/1633247750010830848/8zfRrYjA_400x400.png"- content="Looking to understand or explore some JSON? Just paste or upload to visualize it as a graph with https://jsonvisio.com 😍 Thanks to @aykutsarach!"- />- <PostCard- name="GitHub"- handle="github"- avatar="https://pbs.twimg.com/profile_images/1633247750010830848/8zfRrYjA_400x400.png"- content="Looking to understand or explore some JSON? Just paste or upload to visualize it as a graph with https://jsonvisio.com 😍 Thanks to @aykutsarach!"- />- </Flex>- </Container> */}-<Container mt={100}><Stack><Title color="dark" order={3} maw={500} mx="auto" align="center">diff --git a/src/pages/sign-in.tsx b/src/pages/sign-in.tsxindex fb87a806..dd0b8c3b 100644--- a/src/pages/sign-in.tsx+++ b/src/pages/sign-in.tsx@@ -96,7 +96,7 @@ export function AuthenticationForm(props: PaperProps) {}return (- <Paper radius="md" p="xl" bg="gray.1" withBorder {...props}>+ <Paper radius="md" p="xl" withBorder {...props}><Text size="lg" weight={500}>Welcome to JSON Crack, {type} with</Text>