B4J Question ABMaterial Offline

walterf25

Expert
Licensed User
Longtime User
Hi everyone, i am working on a small web app for work which consists of plotting some data that is retrieved from a nosql datastore, i created a customview using https://plotly.com/javascript/ the reason I decided to use this is because is very simple and it very useful to display statistics.

The graph is working very nice, take a look at the image below, the problem is that I would like to be able to save a single html file and share with other engineers who are not in my team as only engineers who have been whitelisted will have access to this service, the problem is that if I do that then the graph is not interactive anymore, I notice that when I right click on the graph and I click on save as, it download the html file but it also generates a folder where a few css and js files are placed. Now when I open the html file it displays the graph but the graph can not be interacted with, meaning I can't zoom in or out and I can't see the pop up window with statistics when I move the cursor around the graph.

Screen Shot 2021-01-26 at 10.26.49 PM.png

Is there a way to get ABMaterial saved html file to work without being online, I mean I am using a local .js file of the plotly library, so even if the webpage would run outside of the vps environment all the local necessary files are there so i don't see a reason why it would not work.

I hope this makes sense, basically I need to to be able to get the offline html saved page to work, specifically the graph functions.

Thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
No, ABM needs a server (can be local, but still the .jar must be running as it is this that serves the html). It can probably be done in BANano, as that one does not require a server.
Hi @alwaysbusy thanks for the reply, I will try to port everything using BaNano, the problem is that I wrapped a small library to be able to retrieve the data points from the nosql datastore database, will I be able to use the same library in BaNano, i am really not familiar with it, below is the java code I use to achieve this.

B4X:
    public anywheresoftware.b4a.objects.collections.List getEntity(BA ba, String name, long id) {
        anywheresoftware.b4a.objects.collections.List val2 = new anywheresoftware.b4a.objects.collections.List();
        Entity entity = datastore.get(datastore.newKeyFactory().setKind("waveform").newKey(id));
        Map<String, Value<?>> properties = new HashMap<>();
        List<Value<?>> results = entity.getList(name);
        val2.Initialize();
        for (int i = 0; i < results.size(); i++) {
            val2.Add(results.get(i).get());
        }
        return val2;
    }

Thanks, it would be nice if the same library I use with the ABMaterial web app can be used here with BaNano.

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Actually, I'm a bit confused here. If the page has to get its data from a database, doensn't it by default require internet or an intranet?
Yes, but when the data points are retrieved and then plotted with plotly the plotly framework converts the data points into an svg image (paths) and displays it that way, so the data points will remain embedded into the html file and this is the file I want to share, maybe I am explaining it wrong.

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I found a Javascript library but not sure how to implement something like this with BaNano


I'm only interested in retrieving the data, each task is assigned a keyid when saved to the datastore, the keyid is passed as a parameter in the URL and retrieved from within ABMaterial and then passed to the Datastore library so that it knows which dataset to retrieve.

Walter
 
Upvote 0
Top