-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #356 from Razz19/master
Charting Library with Sveltekit(svelte) example
- Loading branch information
Showing
13 changed files
with
1,267 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
static/charting_library | ||
src/lib/charting_library | ||
src/lib/datafeeds |
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,2 @@ | ||
engine-strict=true | ||
resolution-mode=highest |
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,40 @@ | ||
# TradingView Charting Library and Sveltekit(Svelte) Integration Example | ||
|
||
**_The earliest supported version of the charting library for these examples is | ||
`v24`._** | ||
|
||
**_This example is for Sveltekit v.1.0 and Svelte v.4.0 and above_** | ||
|
||
## How to start | ||
|
||
1. Check that you can view | ||
[https://github.com/tradingview/charting_library/](https://github.com/tradingview/charting_library/). | ||
If you do not have access then you can | ||
[request access to this repository here](https://www.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/). | ||
1. Install dependencies `npm install`. | ||
1. Copy the charting library files | ||
1. If you are able to run bash scripts then the | ||
`copy_charting_library_files.sh` script can be used to copy the current | ||
stable version's files. | ||
1. If you are not able to run bash scripts then do the following: | ||
1. Copy the `charting_library` folder from | ||
[https://github.com/tradingview/charting_library/](https://github.com/tradingview/charting_library/) | ||
to `/static` and `/src/lib` folder. | ||
1. Copy the `datafeeds` folder from | ||
[https://github.com/tradingview/charting_library/](https://github.com/tradingview/charting_library/) | ||
to `/src/lib`. | ||
1. Run `npm run dev` to run the app in development mode | ||
with the Charting Library. | ||
1. Run `npm run build` To create a production version of your app. | ||
> You can preview the production build with `npm run preview`. | ||
## What is Charting Library | ||
|
||
Charting Library is a standalone solution for displaying charts. This free, | ||
downloadable library is hosted on your servers and is connected to your data | ||
feed to be used in your website or app. | ||
[Learn more and download](https://www.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/). | ||
|
||
## Credit | ||
|
||
Example kindly provided by [Razz19](https://github.com/Razz19) |
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,25 @@ | ||
#!/bin/sh | ||
|
||
remove_if_directory_exists() { | ||
if [ -d "$1" ]; then rm -Rf "$1"; fi | ||
} | ||
|
||
BRANCH="master"; | ||
|
||
REPOSITORY='https://github.com/tradingview/charting_library/' | ||
|
||
LATEST_HASH=$(git ls-remote $REPOSITORY $BRANCH | grep -Eo '^[[:alnum:]]+') | ||
|
||
remove_if_directory_exists "$LATEST_HASH" | ||
|
||
git clone -q --depth 1 -b "$BRANCH" $REPOSITORY "$LATEST_HASH" | ||
|
||
remove_if_directory_exists "static/charting_library" | ||
remove_if_directory_exists "src/lib/datafeeds" | ||
remove_if_directory_exists "src/lib/charting_library" | ||
|
||
cp -r "$LATEST_HASH/charting_library" static | ||
cp -r "$LATEST_HASH/datafeeds" src/lib | ||
cp -r "$LATEST_HASH/charting_library" src/lib | ||
|
||
remove_if_directory_exists "$LATEST_HASH" |
Oops, something went wrong.