Can we use Google Chart Tools with Google Script HtmlService - google-visualization

I would like to use Google Chart Tools in Google Scripts using the HtmlService.
But I do not know if caja will allow to inject script to show a chart.
My first tests give me blank pages.
Does anyone know if it is at least possible ?
I know Google Script provides 'Charts' service, but the features are limited compared to what allows Google Chart Tools.
Thanks,

If you look at the HtmlService documentation under the Caja section, https://developers.google.com/apps-script/html_service#Caja it says that included libraries are sanitized and so far only JQuery is supported.
Since Chart Tools depend on Google's jsapi, and it appears to do some pretty funky magic, I'd bet it won't pass Caja sanitization right now.
I wonder if there's some way to use the GAS Charts library to produce the charts (albeit statics ones)? But it produces blobs and I'm not sure how to integrate those into the HtmlService's page?!

Charts are not supported just yet.

I had used the Google Chart Tools before the Charts service was introduced. At the fundamental level, Google Chart Tools returns an image of the chart you wish and the data is passed to it via URL parameters.
Using general Javascript, I had developed the logic to build a URL and then get the image using UrlFetchApp and then display it on an Apps Script using UiApp.createImage().
If you can post some code, you could receive more help

This is now possible, sometime over the last 3 months or so.

Related

Resource window of Google BigQuery

I am new to Google BigQuery.
I am now logged into bq console, but the resource window for tables and datasets is too small to navigate and is pinned into bottom left, and its not resizable, please help on how can i unpin the window to navigate it.
It looks like this.
Looks like what you want is something like below
There are many way to accomplish this. I will present two of them
Customize existing/available UI to fit your own specific needs using so called Bookmarklet
Bookmarklets are saved and used as normal bookmarks. As such, they are simple "one-click" tools which add functionality to the browser.
There is a wide usage of bookmarklets - one of which is to modify the appearance of a web page within the browser - which is exactly your use case.
You can create bookmarklet that will switch visibility of elements above the data navigator as in above example
if your needs are more sophisticated and you are looking for more perks than just hiding elements of UI - you can look into third party IDE for BigQuery
I can recommend one to check out - Goliath - the part of Potens.io Suite for BigQuery. You will find there everything you would expected from professional big data IDE tool.
It is free to use and is available on GCP Marketplace
Disclosure - I am part and lead of Potens.io Team (which is also clearly stated in my SO Profile)
Did you mean you want to unpin a project that has "Pin icon" in the screenshot?
If yes, You can unpin a project to clcik "UNPIN PROJECT" right side of bigquery console.
You have to click project(e.g bigquery-public-data) first to meet "UNPIN PROJECT".

Headless chrome cli in Production

I will be doing some pdf generation for my application. Currently, my plan is to create HTML using templates and convert them to PDF.
The pdf's aren't long. Maximum 3 pages. And approximately we will be making approx 100 docs in a day.
I was happy with the results I got from chrome --headless in my local machine. I called the cli command directly from my clojure code. So far so good. Looking at the number of wrappers available (Browserless, Chromeless, Puppeteer, ...) I'm not sure about the scalability factor in production.
Is it safe to use/call the chrome cli directly in production boxes?
What will I miss if I skip these wrappers?
My server side stack is Clojure/Compojure/Leiningen. Any insights/alternatives are appreciated.
I'm using Athena PDF for pdf generation in combination with Clojure:
https://github.com/arachnys/athenapdf
It has a REST interface. Since it runs in Docker its easy to scale.
Instead of detouring through html and chrome, I'd just use a pdf creating library such as clj-pdf. Here is a nice blog post about it.
p.s. If you dont mind running a third program to generate the pdf, I would have used emacs with org-mode (or heck, even writing it in elisp altogether) ;)

Can PowerBI be integrated with Azure Powershell

If I have Azure Powershell cmdlets, can their outputs be directly streamed to Power BI for rendering with visuals?
Thanks!
You may have a look at following link:
https://www.sqlshack.com/connect-query-power-bi-azure-using-powershell/
which may give you a good basic introduction on what you possibly can do with powershell & PowerBI. Range of features and method options may vary depending on cmdlets powershell library package you install. Some options may still run but are listed as deprecated... Also Power BI REST API seems to be the new main driving engine in most scenarios, so you may need to priorly proceed with an AAD App Registration first in order to get any further expected result. Hope this helps.

Can I add a Google Trends graph to Google Data Studio?

I would like to add a Google Trends chart for a specific search term to my Google Data Studio report, but Trends is not an option in the Data Source list. I wasn't able to find an option to embed JavaScript either. Is it possible to add a Trends chart to a report in Data Studio? Thanks!
I am posting this workaround as it seems no similar solution has been provided since.
You can actually do this, using a small workaround:
Create the graph you want to embed using Google Trends.
Click the "embed" icon in the upper right corner of the graph, and copy the JS-code (for either desktop or mobile device)
Create a simple empty HTML-file using notepad or similar text editor. (including , , as per common standard). Place it in an empty folder on your hard drive.
Paste the Google Trends-embed code into the section of your HTML-file.
Go to https://app.netlify.com/drop and upload the whole folder (including your .html-file). Copy the direct link provided by Netlify. (note: Any other form of public hosting should work fine, this is just my personal preference)
In Google Data Studio, click "URL embed" and paste your direct link.
Voila!
(Note: As this is a direct graph link and not a data feed, it, unfortunately, won't let you filter or change settings. but if configured wisely before copying the embed code, should do the trick for any time range, year-on-year or similar needs.)
Hope this helps someone :)
You can use supermetrics.com that has a google trends (free) datasource and then import a common sheet into your dashboard, the only problem is that you wont be able to change the date range, meaning its only "one way"
Unfortunately, the Google Trends data connector has stopped working in Supermetrics. They use an unofficial Google API that has been faulty lately.
The connector was removed Dec 2018.

offline use of the google earth plugin

I have a use case that requires offline access to google earth. I know that google earth enterprise offers a disconnected product, however we may not have access to that product and/or google earth enterprise is prohibitively expensive at $25K for a dev license.
I would prefer to use the google earth plugin since I am building an application and would like to use the JS api. Is it possible to host the google earth plugin on my own disconnected server? We would use google earth connected to a standalone offline WMS server for access to imagery.
said another way, can I host the plugin and corresponding javascript on my own server?
I do not know if i understand well your problem but i can explain you waht I'm currently working on.
Im my current application with google earth plugin js api, I'm able to start the plugin even if offline. But one requirement is to have cached data.
If you have cached data and if you start the plugin offline, then zooming to a level with higher resolution that the one you have in your cached data will have no effect (imagery will not be update to higher resolution)
but depending on what you really need, yes , you can start the plugin offline
This is not really answering your original question but if you are interested, just tell me :-)
I tried to cache Google Earth with a proxy server but I couldn't.
Furthermore I think the api is validated every time it loads against Google Servers and doesn't allow offline use
It's some monthes now since I have worked with this.
I'll try to explain with what i can remember :-)
in the html where i have my plug-in, i have removed:
"script type="text/javascript" src="https://www.google.com/jsapi">
but i have saved locally this jsapi.js file. I also saved locally loader_1-008.js
then, im my code (c++, Qt) I'm using evaluateJavaScript(Qstring source) twice
where source is the text read from my 2 .js files
These 2 evaluateJavaScript calls need to be done before loading my html (the one with the plugin)
in my QWebView
I can not remmeber much more but I hope this can start to help you