Skip to content

Instantly share code, notes, and snippets.

import * as QuickSightEmbedding from 'amazon-quicksight-embedding-sdk';
import { Subscription } from 'rxjs';
export class QuicksightComponent implements OnInit {
quicksightUrl: string;
dashboard: any;
quicksightSubscription$: Subscription;
ngOnInit(): void {
// Replace this code with the api call to get the embedding url
<div id="dashboardContainer"></div>
@Harsh020897
Harsh020897 / generate-embed-url.py
Created June 25, 2021 11:27
Generate QuickSight Embedding URL
import boto3
from botocore.exceptions import ConnectionError, ClientError
import logging
import requests
def create_connection():
try:
print('CONNECTING')
qs = boto3.client('quicksight', region_name=QSREGION) # TODO: Replace with the region in which your quicksight is configured
return qs
@Harsh020897
Harsh020897 / a2i_output.json
Created August 30, 2020 17:31
Sample a2i output gist
{
"flowDefinitionArn": "arn:aws:sagemaker:****",
"humanAnswers": [{
"answerContent": {
"Billing Address": "John Doe 36, Green Downtown, Golden Road, FL",
"Order NO.": "A-8934792734",
"Order Date": "19.06.2019",
"Total Amount": "$47.42"
},
"submissionTime": "2020-08-30T16:52:14.385Z",
@Harsh020897
Harsh020897 / a2i_sample.json
Last active August 30, 2020 17:13
Sample json input
{
"keyValuePairs": [
{
"field": "Buyer Name",
"value": "John Doe",
"confidence": 92
},
{
"field": "Billing Address",
"value": "John Doe 36, Green Downtown, Golden Road, FL",
@Harsh020897
Harsh020897 / index.html
Created August 30, 2020 15:16
Add custom script for calling crowd html submit button
<!-- Create a script to invoke the submit action of the hidden crowd form button element after user clicks on our custom button -->
<script>
document.addEventListener("DOMContentLoaded", function(event) {
const component = document.querySelector('#submit').addEventListener('click', (event) => {
document.querySelector('crowd-form').submit();
});
});
</script>
@Harsh020897
Harsh020897 / index.html
Created August 30, 2020 15:10
Gist of generated template (index.html)
<!doctype html>
<html lang="en">
<html>
<head>
<!-- Crowd HTML elements -->
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script>
<!-- Bootstrap 4 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!-- Material icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">