<graphdisplayer1 rdf-graph=“the graph chosen”> <!-- d3 force graph -->
<graphdisplayer2 rdf-graph=“the graph chosen”> <!-- bar chart -->
<graphdisplayer3 rdf-graph=“the graph chosen”> <!-- pie chart -->
<grapheditor1 rdf-graph=“the graph chosen”> <!-- simple text editor -->
<grapheditor2 rdf-graph=“the graph chosen”> <!-- editor with fancy autocomplete -->
Where the matching attribute values are mapped to shared properties, and the properties are javascript objects.
Since this is declarative, they would all show at once, and the changes when choosing another file or editing in an editor would be reflected in the other elements.
Then lots of apps could be built with similar html tags, especially if templates for enumerating lists are also possible. @happybeing’s application generator could also be built this way.
@anon36056958 it’s totally feasible, and it’s why I love webcomponent, although I don’t like the way they normally share data, with data-binding or other redux tools.
I prefer that they are totally autonomous, so that they talk to each other through the evejs agent system . (@dprat0821)
Each component has a ''named agent" that send data to the agent of another component.
When this agent receive data, he updates the components.
So an app can be build out independent reusable autonomous components as easily as every htmlTag.
Then it would also be easy to replace for example a component by another. If I want my graph to be made with d3js instead of visjs, just import the equivalent component, and use it’s tag & name of communicating agent…
I’d not really know what could be in a piechart component , but I will give you a proto of your desired app, with components that exchange those data to each other
Or you can give a try by copying this folder https://github.com/scenaristeur/solidash/tree/master/compagent-spoggy.
It’s all you need to start that type of app ( just duplicate the component/modele-component.js and name it graph-editor ( carefully, dash is necessary) .
In this file change the name at the three place you find model-component or ModelComponent .
Then you can import it in component/component-app.js and use it as a new htmlTag …
Can’t be more simple and it works in the browser, don’t need webpack or other preparation… So could be directly installed on a Pod …
Yes , for every component, I use a ‘name’ attribute.
Then I create an HelloAgent with that name. So the chooser ( in fact the tripledoc-profile that is part of the chooser use "this.agent.send(“recipient-agent”, {action: something, data:data) . And in the recipient I use the “receive” prototype to link a function to each type of action. That’s the way I use to make communication between components. Broadcast can also be used as in the login component
Well hum … If the component is well done, no need to write js for the end user.
For example just put a login-comp and a message-comp in a page, the login broadcast when you login and message-comp get the message.
But as a developer of module, you have to define the interface to interact with a component, the inputs & the outputs…
What about putting the interface in the html attributes though? So you could have an attribute like ‘rdf-graph’ with a string value, and that string value would cause a property of that name to be defined for the first component that uses it. Then the next component that uses the same rdf-graph would also have an attribute named ‘rdf-graph’ with the same value as the rdf-graph in the first component and the second component would get a pointer to that property in the first component, and be notified if that property changes. That way the name of the ‘channel’ or interface between the two components would be in the html. The user could choose the channel name and have different channels for the same attribute. The user could put whatever components they wanted on a channel as long they consumed that type of property. Then they could have different sets of components share channels with different names. That way they could have multiple sets of the same kind of components.
If I remember correctly from my polymer period (a couple of years ago), you can do this with data binding, but maybe it could also be done with eventjs.
I don’t know Polymer or how other frameworks do this so I’m a bit of a noob but that never stopped me before …
…so just to mention that the way Svelte binds variables is neat. I don’t understand the full capabilities yet, but you can bind variables to a formula/expression and even a function. So if the inputs change the output is recalculated.
So that might be a way to build components, but specific to Sveltejs
I think I’ve already mentioned Holochain CEPTR, stop just a reminder about that!
It would be useful for displaying different resources side by side, for example a resource and it’s .acl or it’s .meta., or different views or parts of the same resource side by side.
But I agree about polymer’s data binding not being ideal.
Found this which compares data binding code from 9 different frameworks, although it’s a few years old. I don’t know but maybe we need something custom made, but I don’t think it would have to be too fancy.
Web components (made with whatever framework) could share references to things like rdf resources, non rdf resources, web id’s, pods, results from other components, etc., and do it through html attributes with agreed on names, like ‘rdf-resource’ or ‘rdf-graph’ or ‘web-id’, ‘pod’, so no javascript has to be written to make an app. Also new components could be made this way from existing components.
This would be a flexible and simple way to make apps. It only needs agreement on attributes and maybe some kind of simple, generic way of data binding. This library looks like the kind of thing that might be useful.
There is a barrier in terms of learning new things and new ways (federated, social, semantic, client side business logic etc) but I think overall Solid is no more difficult and may even be simpler, because the backend is done for you, simple, standard and once learned won’t change.
The level of difficulty will depend on the nature and complexity of the app, but I don’t see this as an inhibitor because there will be so much scope for simple apps in the short and medium term.
I could elaborate because I’ve thought about this in the context of Solid on SAFE, for a couple of years now.
So I am sure it is not out of the reach of individual developers, or even significantly harder - apart from being like learning a new framework. So a barrier, but not hard to overcome and equally an opportunity to be there first.
I hope you’re right. I don’t mean to be discouraging. I’m just trying to make the case for components (doesn’t seem to be working)…
But aside from being new, I think the decentralized nature of not only the servers for the data but also the decentralized nature of webids make it more complex than a traditional desktop or client server app.
They could use the publish/subscribe pattern for the data binding.
Channels might be named or namespaced according to attribute name and maybe also the attribute value. The corresponding property name could be derived from that.
Publishers could also be subscribers as long as they ignore their own publications and don’t publish in response to a subscription.
would be both a publisher and subscriber on the same channel.
Subscriber only components would be like read only components and components that publish and subscribe would be like read/write components. Components that are composed of only subscribing components would themselves be only subscribers, but if they’re composed of any publishing components they would be publishers on those channels.
There would be channels for web id’s, profiles, standard things.
Using components to compose apps seems logical to me, but maybe I’m not understanding the big picture.
So for example with custom web components for Solid (in my dreams), the following html could log sideshowtom in to agora’s pod and display someFile.ttl in a force field graph, and also a file browser with someFile.ttl selected
(the webId and pod channels are implicit, and the someFileChannel is explicitly declared. Browsing with the file browser will change the file and the data on the someFileChannel channel so the graph will be updated)
FYI I just learned that sveltejs can output Web Components, so you can build stuff using Svelte components which are really easy to create and use, and then also share them for use with with other frameworks.
I haven’t tried it yet, but have been building some Svelte components to visualise graphs using d3-force which would make a good test.
How to create Web Components Using Sveltejs
It’s trivial using the publish-svelte CLI, or you can set up your build in webpack or rollup etc as explained below.
publish-svelte - CLI to publish Svelte components to npm or stand-alone web components (github)
A channel could maybe take a json array for cross pod channels and multi-edit or upload of files …also maybe resource browser could take a form submitted