Generate DrawIO / jGraph Diagram from CSV Programmatically? - draw.io

This feels like it should be possible. But I've not managed to find out how just yet.
To achieve this via the desktop application it's simple;
Use the Arrange > Insert > Advanced > CSV option
Diagram generated
Export to HTML or SVG
Open up in Chrome
I want to achieve this programmatically because the data that is entered as part of Step 1 will be created on the fly.

Not possible at time of writing - https://github.com/jgraph/drawio-desktop/issues/591
Update
"this was recently fixed since v20.7.4 (github.com/jgraph/drawio-desktop/issues/…) –
Exodus 4D"

Related

Read-in df from csv before launching main app | Dash

I am trying to get my first dashboard with python dash running.
The whole thing is very similar to this https://github.com/dkrizman/dash-manufacture-spc-dashboard.
At the beginning a Dataframe is read in from a csv. My problem seems to be quite easy to solve but somehow I am not succeeding:
I want to create a initial window that allows the user to select (from e.g. dropdown) the csv file (or accordingly the path) that is read in. All the .csv files look the same but just have different values.
When using the modal components I get problems with the install of bootstrap and I thought there must be an easier way?
Thanks for your help!
Best,
Nik

Power BI Desktop - How to change data source?

When I'm trying to change my existing data source (Microsoft Azure CosmosDB) to Blob Storage, the Change source is disabled. How do I workaround this?
I have gone through various questions but none of them were similar to mine.
Any help is much appreciated.
Thanks
Workaround
Click on edit queries
Select the query
Advanced Editor
You can change the datasource from here.
Then do apply , export if necessary
Like #rinjan stated above go to the advanced editor on your table in the query editor. Then you will get something like this (This is an Excel connection):
let
Source = Folder.Files("J:\TestPath"),
#"J:\TestPath\Map1 xlsx" = Source{[#"Folder Path"="J:\TestPath\",Name="Map1.xlsx"]}[Content],
#"Imported Excel" = Excel.Workbook(#"J:\TestPath\Map1 xlsx"),
Map1_Sheet = #"Imported Excel"{[Item="Map1",Kind="Sheet"]}[Data],
....and so on
Best way to go here is to copy paste the whole text into the text editor and chose the option replace all with the following line (for this example):
Old value: J:\TestPath
New value: J:\New\Path
If it is not working you have to inspect the lines of codes. Maybe you find the missing piece.
The first line of every table must be Source:
https://community.powerbi.com/t5/Community-Blog/Why-can-t-I-change-the-Data-Source-in-Power-BI-disabled-button/ba-p/915365

Formula.Firewall: Query 'Sentiment Results' (step 'Custom1') references other queries or steps, so it may not directly access a data source

I want to learn sentiment analysis and am learning from this tutorial https://community.powerbi.com/t5/Community-Blog/Sentiment-Analysis-in-Power-BI/ba-p/55898, but I got an error:
Formula.Firewall: Query 'Sentiment Results' (step 'Custom1') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
I tried to change Data source setting > Edit privacy level, but that did not work.
To solve the issue you must do Fast Combine Setting, found in File > Options and settings > Options and then Current File > Privacy determines whether Power BI Desktop uses your Privacy Level settings while combining data.
Reference :
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-privacy-levels/

How can Excel 2007 / 2010 consume a REST web service?

What options exist to consume a REST web service from within Excel 2007 / 2010? I can use XML Maps to consume a basic XML list, but that doesn't let me build a dynamic URL (so I could include parameters).
For example, I can add an XML Map to Excel for http://machine/service/level/5 and display the values in the workbook just fine - no problem there. The real question is, how can I dynamically change the /5 part of the URL to come from another cell in excel?
That way I can have a couple of cells that have the options (what ID, what name, etc.) and whenever those values change (ideally) a new dynamic URL would be constructed and the XML map would be refreshed.
Is such a thing possible? Does anyone else have a better way to take some parameters, call a web service (REST or SOAP, I'm not picky) and shove the results back into excel for further manipulation?
XLLoop (http://xlloop.sourceforge.net/) can be used to call make Json of HTTP calls.
You can use PowerPivot with Excel 2010. Download from here.
From the home tab select 'From Data Feeds', then 'From Other Feeds'.
You should be able to use this to point to your URL.
I've read that PowerPivot uses REST but I haven't tried it myself.
Good luck! :)

TextMate: Preview in Firefox without having to save document first?

Using TextMate:
Is it possible to assign a shortcut to preview/refresh the currently edited HTML document in, say, Firefox, without having to first hit Save?
I'm looking for the same functionality as TextMate's built-in Web Preview window, but I'd prefer an external browser instead of TextMate's. (Mainly in order to use a JavaScript console such as Firebug for instance).
Would it be possible to pipe the currently unsaved document through the shell and then preview in Firefox. And if so, is there anyone having a TextMate command for this, willing to share it?
Not trivially. The easiest way would be to write the current file to the temp dir, then launch that file.. but, this would break any relative links (images, scripts, CSS files)
Add a bundle:
Input: Entire Document
Output: Discard
Scope Selector: source.html
And the script:
#!/usr/bin/env python2.5
import os
import sys
import random
import tempfile
import subprocess
fname = os.environ.get("TM_FILEPATH", "Untitled %s.html" % random.randint(100, 1000))
fcontent = sys.stdin.read()
fd, name = tempfile.mkstemp()
print name
open(name, "w+").write(fcontent)
print subprocess.Popen(["open", "-a", "Firefox", name]).communicate()
As I said, that wont work with relative resource links, which is probably a big problem.. Another option is to modify the following line of code, from the exiting "Refresh Browsers" command:
osascript <<'APPLESCRIPT'
tell app "Firefox" to Get URL "JavaScript:window.location.reload();" inside window 1
APPLESCRIPT
Instead of having the javascript reload the page, it could clear it, and write the current document using a series of document.write() calls. The problem with this is you can't guarantee the current document is the one you want to replace.. Windows 1 could have changed to another site etc, especially with tabbed browsing..
Finally, an option that doesn't have a huge drawback: Use version control, particularly one of the "distributed" ones, where you don't have to send your changes to a remote server - git, mercurial, darcs, bazaar etc (all have TextMate integration also)
If your code is in version control, it doesn't matter if you save before previewing, you can also always go back to your last-commited version if you break something and lose the undo buffer.
Here's something that you can use and just replace "Safari" with "Firefox":
http://wiki.macromates.com/Main/Howtos#SafariPreview
Open the Bundle Editor (control + option + command + B)
Scroll to the HTML Bundle and expand the tree
Select "Open Document in Running Browser(s)"
Assign Activation Key Equivalent (shortcut)
Close the bundle editor
I don't think this is possible. You can however enable the 'atomic saves' option so every time you alt tab to Firefox your project is saved.
If you ever find a solution to have a proper Firefox live preview, let us know.