Hello Superset Community!

I've recently found out that Apache Superset could be useful for me to 
implement some solutions for SQL-related problems. However, as I'm a novice 
Superset user and in overall I don't have much experience in web development, I 
got stuck with a few issues. The most important that I want to ask you about is 
the following.

I want to develop a custom visualization plugin. I've created and modified the 
Hello World plugin successfully and shown my datasets in it. But I want to do 
more SQL queries from the plugin itself, so that the queries would be 
independent from the already visualized dataset's structure.

For example, suppose I have a table called "entities", which I don't want to 
show as a part of the visualized dataset:

entity_id
entity
1
...
2
...
3
...

Here, "entity_id" is just an integer and "entity" is a large binary or 
text/varchar(max) entry. I only want to pass "entity_id"s to the end user with 
extra data to play around, so the dataset passed to the plugin will look like 
this:

entity_id
param1
param2
param3
...
...
...
...
...
...

And once the user wants to check out what exact entity is stored under certain 
"entity_id", then and only then the plugin does something like a dynamic query

select e.entity from entities as e where e.entity_id = %user_chosen_id %;

and passes the result to the user.

With this, I plan to:
1) Drastically reduce the amount of large unneeded data passed via the network.
2) Don't bother the user with writing their own select queries by hand.

The problem is, I can't figure out how to do queries like that from within the 
chart plugin.

Thus I have a few questions from what I tried to figure out:

1) I see "buildQuery" param passed to the ChartPlugin instance but I can't find 
any documentation on how to use it, with examples.
1.1) Does it somehow solve my problem? If not, what does it used for then?
1.2) Where can I find examples on usage of nontrivial buildQueries? Is there 
any tutorial or default plugin in the "superset-ui" repo or somewhere else that 
I can take a look at?

2) In the HelloWorld boilerplate, I see much more props passed to the 
transformProps function, than filtered out to be passed to the plugin's 
PureComponent
2.1) Does any of those props contain callbacks which I can call to execute 
custom SQL queries?

3) If none of the above works, how can I let the plugin do its own extra SQL 
queries or probably HTTP requests to the Superset backend after the main 
dataset's already been loaded?

I'll greatly appreciate your help!

------------
Regards,
Egor


--------------------------------------------------------------------
Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park,
17 Krylatskaya Str., Bldg 4, Moscow 121614,
Russian Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Reply via email to