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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
Programmatically **embed** and **control** MongoDB Charts in your application.

[![npm](https://img.shields.io/npm/v/@mongodb-js/charts-embed-dom.svg)](https://www.npmjs.com/package/@mongodb-js/charts-embed-dom/)
[![npm](https://img.shields.io/npm/l/@mongodb-js/charts-embed-dom.svg)](https://www.npmjs.com/package/@mongodb-js/charts-embed-dom/v/beta)
[![npm](https://img.shields.io/npm/l/@mongodb-js/charts-embed-dom.svg)](https://www.npmjs.com/package/@mongodb-js/charts-embed-dom/)

<img align="center" src="https://user-images.githubusercontent.com/19422770/79284750-efe86800-7efe-11ea-9ed0-9813e1a0b6d6.gif" />

[Explore this example yourself!](https://codesandbox.io/s/charts-embedding-sdk-8i898)
[Explore this example yourself!](https://codesandbox.io/s/github/mongodb-js/charts-embed-sdk/tree/master/examples/unauthenticated)

</div>

Expand All @@ -26,7 +26,7 @@ yarn add @mongodb-js/charts-embed-dom

## Documentation 📖

- [Installation](https://docs.mongodb.com/charts/master/embedding-charts-sdk/)
- [Installation & MongoDB Docs](https://docs.mongodb.com/charts/master/embedding-charts-sdk/)
- [Examples](https://github.com/mongodb-js/charts-embed-sdk/blob/master/examples)
- Guides 🤠
- [Getting started with custom JWT authentication](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/authenticated-custom-jwt)
Expand Down
2 changes: 1 addition & 1 deletion examples/authenticated-custom-jwt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "parcel build index.html"
},
"dependencies": {
"@mongodb-js/charts-embed-dom": "^1.0.0-beta.2",
"@mongodb-js/charts-embed-dom": "^1.0.0",
"cors": "^2.8.5",
"express": "^4.16.3",
"jsonwebtoken": "^8.3.0",
Expand Down
13 changes: 6 additions & 7 deletions examples/authenticated-google/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
/>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src="https://unpkg.com/@mongodb-js/charts-embed-dom@beta"></script>
<script src="https://unpkg.com/@mongodb-js/charts-embed-dom"></script>

<!-- Optional: ~REPLACE~ content with your Google Client ID -->
<meta
Expand All @@ -20,24 +20,23 @@
</head>

<body>
<script>
<script>
function onSignIn(googleUser) {
const id_token = googleUser.getAuthResponse().id_token;
const ChartsEmbedSDK = window.ChartsEmbedSDK;

console.log("ID TOKEN == " + id_token);
const sdk = new ChartsEmbedSDK({
baseUrl: "https://charts-dev.mongodb.com/charts-test2-pebbp", // Optional: ~REPLACE~ with your Charts URL
getUserToken: () => id_token
getUserToken: () => id_token,
});

const chart = sdk.createChart({
chartId: "0d984f0c-5f1b-4711-9e5d-f78aa1ea8fcb", // Optional: ~REPLACE~ with your Chart ID
});

document.body.classList.toggle("logged-in", true)
chart.render(document.getElementById("chart"));

document.body.classList.toggle("logged-in", true);
chart.render(document.getElementById("chart"));
}
</script>
<script type="text/javascript" src="src/index.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/authenticated-realm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "parcel build index.html"
},
"dependencies": {
"@mongodb-js/charts-embed-dom": "0.0.0-dev.12",
"@mongodb-js/charts-embed-dom": "^1.0.0",
"jsonwebtoken": "^8.3.0",
"mongodb-stitch-browser-sdk": "^4.8.0",
"parcel": "^1.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/unauthenticated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "parcel build index.html"
},
"dependencies": {
"@mongodb-js/charts-embed-dom": "1.0.0-beta.2",
"@mongodb-js/charts-embed-dom": "^1.0.0",
"regenerator-runtime": "^0.13.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/unauthenticated/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

📄 _[See the MongoDB Charts Embedding Docs for more details](https://docs.mongodb.com/charts/saas/embedding-charts/)_

🎮 _[Play with a live demo of this sample here](https://codesandbox.io/s/github/mongodb-js/charts-embed-sdk/tree/master/examples/authenticated-custom-jwt)_
🎮 _[Play with a live demo of this sample here](https://codesandbox.io/s/github/mongodb-js/charts-embed-sdk/tree/master/examples/unauthenticated)_

MongoDB Charts allows you to create visualizations of your MongoDB data using a simple web interface. You can view the visualizations within the Charts UI, or you can use the Embedding feature to render the charts in an external web application.

Expand Down