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: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ yarn add @mongodb-js/charts-embed-dom
- [Getting started with custom JWT authentication](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/authenticated-custom-jwt)
- [Getting started with Realm authentication](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/authenticated-realm)
- [Getting started with Google authentication](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/authenticated-google)
- [Getting started with click events (BETA)](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/click-events-basic)
- [Interactive filtering using click events (BETA)](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/click-events-filtering)
- [Getting started with click events](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/click-events-basic)
- [Interactive filtering using click events](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/click-events-filtering)
- [Programmatic highlighting](https://github.com/mongodb-js/charts-embed-sdk/tree/master/examples/programmatic-highlighting)
41 changes: 41 additions & 0 deletions examples/programmatic-highlighting/assets/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
html,
body {
font-family: "Heebo";
transition: background-color 0.5s ease;
}

.body-content {
display: flex;
}
.chart {
flex: 1;
width: 50%;
height: 70%;
}

.options-container {
margin-top: 2rem;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}

label {
font-weight: 700;
}

.options {
display: flex;
flex-direction: column;
min-width: 30rem;
width: 60%;
}

.select {
height: 30px;
}

h1, h2, h3, h4 {
text-align: center;
}
38 changes: 38 additions & 0 deletions examples/programmatic-highlighting/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>

<head>
<title>Charts Embedded SDK Demo: Interactive Filtering</title>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
<link href="https://fonts.googleapis.com/css?family=Heebo&display=swap" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="assets/styles.css" />
</head>

<body>
<main>
<h2>Change highlights for both charts</h2>
<div class="body-content">
<div class="chart" id="chart1"></div>
<div class="chart" id="chart2"></div>
</div>
<div class="options-container">
<label for="options">Choose a predefined filter document to highlight the chart data, or enter your own MQL
filter.</label>
<div id="options" class="options">
<select id="query-select">
<option value="simple">Exact match</option>
<option value="range">Using comparisons</option>
<option value="complex">Using $and</option>
<option value="empty">Applying {}</option>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more clear if the text here is 'Remove highlights' instead of "Applying {}"?

<option value="custom">Custom query</option>
</select>
<textarea id="query-text" rows="10" cols="33"></input>
</div>
</div>
</main>
<script src="src/index.js"></script>
</body>

</html>
Loading