|
23 | 23 | <div class="grid gap-3"> |
24 | 24 | {#if selectedTab === 'svelte-ux'} |
25 | 25 | <div> |
26 | | - Follow the <a href="https://svelte-ux.techniq.dev/">Svelte UX</a> instructions to create a new |
27 | | - project |
| 26 | + <h2>Setup project</h2> |
| 27 | + <p> |
| 28 | + Follow the |
| 29 | + <a href="https://svelte-ux.techniq.dev/">Svelte UX</a> instructions to create a new project |
| 30 | + </p> |
28 | 31 | </div> |
29 | | - |
30 | | - <div>Install <code>layerchart</code> package</div> |
31 | | - <Code source={`npm install layerchart`} language="sh" /> |
32 | | - |
33 | | - <div>Update LayerChart components to <code>tailwind.config.cjs</code> content</div> |
34 | | - <Code |
35 | | - source={`module.exports = { |
36 | | - content: [ |
37 | | - './src/**/*.{html,svelte}', |
38 | | - './node_modules/svelte-ux/**/*.{svelte,js}', |
39 | | - './node_modules/layerchart/**/*.{svelte,js}' // <--- Add this |
40 | | - ], |
41 | | -};`} |
42 | | - language="js" |
43 | | - /> |
44 | 32 | {:else if selectedTab === 'standalone'} |
45 | 33 | <div> |
46 | | - Follow the Tailwind <a href="https://tailwindcss.com/docs/guides/sveltekit" target="_blank"> |
47 | | - guide |
48 | | - </a> to setup a new SvelteKit project with Tailwind. |
49 | | - </div> |
50 | | - |
51 | | - <div>OR</div> |
52 | | - |
53 | | - <div>Start a new project SvelteKit project</div> |
54 | | - <Code source={`npm create svelte@latest`} language="sh" /> |
55 | | - |
56 | | - <div>Install <code>layerchart</code> package</div> |
57 | | - <Code source={`npm install layerchart`} language="sh" /> |
58 | | - |
59 | | - <div> |
60 | | - Add and setup Tailwind using <a |
61 | | - href="https://github.com/svelte-add/tailwindcss" |
62 | | - target="_blank" |
| 34 | + <h2>Setup project</h2> |
| 35 | + Use can use LayerChart with your existing project, such as |
| 36 | + <a href="https://www.skeleton.dev/" target="_blank">Skeleton</a>, |
| 37 | + <a href="https://www.shadcn-svelte.com/" target="_blank">shadcn-svelte</a>, or |
| 38 | + <a href="https://daisyui.com/" target="_blank">Daisy UI</a>, although we are still |
| 39 | + evaluating the best integration approach and would love your feedback (<a |
| 40 | + href="https://discord.gg/697JhMPD3t" |
| 41 | + target="_blank">Discord</a |
63 | 42 | > |
64 | | - svelte-add |
65 | | - </a> |
| 43 | + or <a href="https://github.com/techniq/layerchart/pulls" target="_blank">pull requests</a>). |
| 44 | + |
| 45 | + <p> |
| 46 | + You can also create a new Tailwind project following their |
| 47 | + <a href="https://tailwindcss.com/docs/guides/sveltekit" target="_blank">guide</a> |
| 48 | + or use |
| 49 | + <a href="https://github.com/svelte-add/tailwindcss" target="_blank">svelte-add</a>. |
| 50 | + </p> |
| 51 | + |
| 52 | + <Blockquote> |
| 53 | + <div> |
| 54 | + Ongoing investigation to support non-Tailwind projects is being investigated, including |
| 55 | + using <a href="https://unocss.dev/" target="_blank">UnoCSS</a> or vanilla CSS, but they are |
| 56 | + undocumented and unsupported at this time. |
| 57 | + </div> |
| 58 | + </Blockquote> |
66 | 59 | </div> |
67 | | - <Code source={`npx svelte-add@latest tailwindcss`} language="sh" /> |
68 | 60 | {:else if selectedTab === 'manual'} |
69 | 61 | <div> |
70 | 62 | Follow the Tailwind <a href="https://tailwindcss.com/docs/guides/sveltekit" target="_blank"> |
|
77 | 69 | {/if} |
78 | 70 | </div> |
79 | 71 |
|
| 72 | + <h2>Install package</h2> |
| 73 | + |
| 74 | + <div>Install <code>layerchart</code> package</div> |
| 75 | + <Code source={`npm install layerchart`} language="sh" /> |
| 76 | + |
| 77 | + <Blockquote> |
| 78 | + <div> |
| 79 | + <div class="mb-1"> |
| 80 | + Depending on the example, you will typically need additional <code>d3</code> packages such |
| 81 | + as <code>d3-scale</code> and <code>d3-array</code> |
| 82 | + </div> |
| 83 | + <Code source={`npm install d3-scale d3-array`} language="sh" /> |
| 84 | + </div> |
| 85 | + </Blockquote> |
| 86 | + |
| 87 | + <div>Update LayerChart components to <code>tailwind.config.cjs</code> content</div> |
| 88 | + <Code |
| 89 | + source={`module.exports = { |
| 90 | + content: [ |
| 91 | + './src/**/*.{html,svelte}', |
| 92 | + './node_modules/svelte-ux/**/*.{svelte,js}', |
| 93 | + './node_modules/layerchart/**/*.{svelte,js}' // <--- Add this |
| 94 | + ], |
| 95 | +};`} |
| 96 | + language="js" |
| 97 | + /> |
| 98 | + |
80 | 99 | <h2>Usage</h2> |
81 | 100 |
|
82 | 101 | <p>LayerChart components can be easily imported into your project.</p> |
|
100 | 119 | </p> |
101 | 120 |
|
102 | 121 | <p> |
103 | | - The examples do not currently show the importing of LayerChart components, utilties, external |
| 122 | + The examples do not currently show the importing of LayerChart components, utilties, or external |
104 | 123 | libraries (i.e.<code>{'<script>'}</code> |
105 | | - block). You can view the full page source by clicking on **Page source** at the top of each examples |
106 | | - page. This will show you all of the imports used for that page. |
| 124 | + block). You can view the full page source by clicking on <strong>Page source</strong> at the top |
| 125 | + of each examples page. This will show you all of the imports used for that page. |
107 | 126 | <Blockquote> |
108 | 127 | <div> |
109 | 128 | <strong>Note:</strong> This site is built directly from LayerChart's codebase and does not |
|
0 commit comments