New Grasshopper User Interface builder now on demo - DKUI

Hi Guys,

I’ve just uploaded a demo/MVP of a new Grasshopper GUI builder - DKUI:

DKUI is built on ETO.Webview so runs cross platform. The actual user interface is completely Web technology based - HTML/JS/CSS.

Building UI’s is somewhat similar to the classic HumanUI system - maybe a little simpler.

I’ve been using the ‘bones’ of this UI system in my own Rhino Plugin products for a couple of years.

This is a rebuild that removes 3rd party dependencies and cleans the code up for public consumption.

Current user inputs available:

  • Tab controls (for tab style pages)
  • Button
  • Check Box
  • Number Input
  • Number Slider
  • Pull Down List
  • Toggle Button

To set the appearance of your UI I’ve built a pair of ‘CSS’ builder components - one with light mode presets and the other with dark mode. There is also a component that can tell you which mode Rhino is currently set - to allow switching between display styles.

To be able to save/load the state of your DKUI driven GH programs I’ve also added some components to:

  • Read the complete UI state to key/value pairs (for saving program state)
  • Load a set of key/value pairs to the UI (for loading program state)
  • Saving and Loading Key/Value pairs to/from the Rhino Document User Text

Feel free to have a look and send feedback/wish lists.

I will schedule a time to make a “How To” video in coming weeks.

Cheers

DK

250522_DKUI MVP demo.gh (24.4 KB)

4 Likes

Love the direction. Using a Webview for UI’s is something that I’ve been considering for while to make it easier for my team to flex between our different environments.

Are you planning to release this as an opensource tool, a free to use tool, or a paid plugin in the long term?

1 Like

@cullen.sarles thanks for the kind words mate.

The main appeal for using WebView is the honestly MASSIVE amount of documentation for html based UIs online. Tho ETO is likely the best choice for Rhino built in support, it’s learning resources are low and it’s learning curve is steep.

The question about future plans is a good one. In this thread there is a discussion about the current state of GH user interface building tools:

In many cases the projects are no longer being supported or developed, which is particularly painful for many with HumanUI.

DKUI exists purely because it solves my own problems, solving these problems has allowed me to develop three commercial rhino plugin products in the last three years.

DKUI is likely a useful solution for others as well, but in releasing it as a plugin I will also then be responsible for the performance of others projects, not just my own.

This video has an interesting take on FOSS:

As of today HumanUI is listed as having 60k downloads on Food4Rhino. I personally used it in the early days of development of my commercial plugin products. I’ve never sent Andrew any money for his amazing work on this plugin, I don’t even know how too? If HumanUI had a paid level of use, would Andrew still be interested in maintaining and upgrading it?

I don’t have an answer, for you, DKUI is my first Grasshopper plugin. Nautilus is the only GH plugin I know of that has a paid level of use.

As a developer, even a small amount of income from your work can be highly motivating to keep it up to date and improving.

Maybe others have ideas for how a project that is useful for so many users could reward the time and effort put into its upkeep.

Cheers

DK

So, a new copy of DKUI is up on the package manager - V25.5.22.1:


I’ve added:

  • New Styling Options
  • Better feedback on Slider Values
  • Hover over Tool Tips for most input values
  • Save and load UI state from local files
  • Text Style components for H1/H2/H3/P html text types
  • Color Picker input
  • Second Tabs style that uses text link rather than buttons

Let me know if you have had a look at this plug-in.

Cheers

DK

250522_DKUI MVP demo.gh (24.1 KB)

It’s an open source project. Maybe you can upgrade it. I know Andrew does accept pull requests.

@stevebaer tho I would be very keen to contribute there are two issues,

1/ HumanUI is windows only, so even tho it’s an amazing piece of work that does a great job, it no longer suits my requirements

2/ My c# skills amount to less than zero, like wth does that “void” keyword mean and why is it in the first line of every c# source I see?? I’m somewhat productive in Grasshopper and somewhat dangerous in Python…

Cheers

DK

I understand and was simply pointing out this option

2 Likes

I also find this notation stupid. Here is a dictionary:

class = glass
void = no_beer
private = I
public = We
method = to drink

modifier return type function(in) => You get …

So:
public void MyMethod(MyClass myClass, int n, double durationSeconds){}

Translates to:
You get no beer when we drink n-glass of beers in x-seconds.

Cheers

4 Likes

New version uploaded to the package manager today with default styling better matched to Rhino light and dark styles:

Cheers

DK

250525_DKUI MVP demo.gh (25.8 KB)

1 Like

Nice AI generated overview of the benefits of using HTML/CSS/JS for desktop UI:

Cross-Platform:

Web technologies are platform-independent, allowing you to build apps that run on Windows, macOS, and Linux with minimal code changes.

Large Developer Ecosystem:

The web development community is vast, and a wealth of libraries, frameworks, and resources are available for building UI components.

Faster Development:

Web technologies offer a relatively fast development cycle, allowing for quicker prototyping and iteration.

Web Standards:

Leveraging web standards ensures that your UI is compatible with modern browsers and devices.

Limitations:

Performance:

While web technologies are generally fast, rendering complex UI elements within a browser can sometimes be slower than native UI frameworks.

Native UI Elements:

Creating complex UI elements that closely match native operating system styling can be more challenging.

System Integrations:

Certain system integrations can be more complex to implement compared to native UI frameworks.

Web-apps are running inside a sandbox (Browser). This is safe, and works exactly the same on all machines with the same browser version. But you are not indented to leave this sandbox, e.g. to access the file-system.

“Webviews” or technologies like Elektron are embedding an entire browser inside a Window and solve this access problem by providing an interface to the system. Nowadays its quite optimised and has a relative low footprint of memory and cpu usage. But if you consider that you instantiate an entire browser just for provide basic controls, then you could argue that this very inefficient. Also its not guaranteed anymore that it acts the same on every system. So you cannot assume that your application works on MacOs the same as on Windows anymore. Even if its less likely to run into OS specific differences.

Have you observed memory?

Hi @TomTom

All very good points you make there - and I mostly agree.

For access to the file system, since a local copy of GH is my ‘back end’, I use buttons to trigger the standard Rhino Script Syntax UI file open/save tools and let the GUI just be the GUI.

I do have some some small cross platform issues I need to sort out, fonts and some text encoding - but in the big scheme of things they are minors.

If we were arguing the most efficient way to develop desk top apps and plugins we would not be starting in Grasshopper! And you have called me out directly on this in ‘that thread’. However I’ve not seen any major overhead. The current Rhino 8 I have open with my source and the Rhino Script editor running is 578MB, Thunderbird, Chrome and Dropbox are all taking more memory to run than this.

Hoping to get some time later this week to do a ‘Getting Started with DKUI’ video. Watch this space.

Cheers

DK

Some updates on DKUI this evening, now on the Package Manager:

Lots of options now available to save and load UI state.

Cheers

DK


THIS IS INSANE!!!

3 Likes

Rhino has finally been wired into The Matrix - are we all doomed?

2 Likes

First of all, thank you for sharing such an awesome plugin!
I have two questions.
Is it possible to fix the position of the panel to a specific location?
As of now, it seems like I have to manually adjust it to the desired spot every time I open the file.
The other question is whether it’s possible to upload a file.
Everything else works great—text, sliders, dropdowns, color settings—but I find it a bit unfortunate that file upload isn’t supported.

Cheers!

First of all, thank you for making this available for everyone. I remember discussing your work with interfaces and thoroughly impressed by your approach. I tested the plugin and just the fact that it is cross-platform, easily modifiable with html elements, and super quick to set up I think this is truly the success to Human UI. Human UI is really amazing for what it does but I think your system even in beta does pretty much 99 percent of what users normally require.

Just couple of thoughts and questions:

  • Any plans to implement file/folder picking input? Would be a great combination with the load/save features you have added.
  • I have not really tried this but how is webview suitable for hiding/showing inputs parametrically? That is one area where Human UI was really powerful. I think the webview redraws every time so shouldn’t be a problem?
  • It really does feel snappier and super lightweight compared to other interface plugins.
  • Are you planning a table view to show data? Or what is the best approach to visualize quantities in realtime?
  • Something I am going to test is compiling scripts with your UI and Script Editor in R8 to create standalone tools for my team.

All in all, amazing stuff. Cannot wait to see how it progresses. Beer on its way.

1 Like

@Muhammad_Talha_Mufte thank you very much for your kind words and your contribution to the project. Here is proof of work:

On you questions:

File Picker

You are the second person in the last 24hrs to ask for this. For myself, even when I used HumanUI I simply hooked a UI button to trigger a python component and used the Rhino Script Syntax OpenFile dialogue. This wont take long at ALL to add to the components list - consider it #1 project for next release.

Hiding/showing inputs

Very possible and very simple to do, I have a couple of examples going already in my own code. IN FACT the whole TABS setup in DKUI is just a big version of this. I’ll cue this up as a video topic and cover in depth for you.

Data Table

Its on the development list, no time frame yet. KaroroCAD has a version of this going but to be honest that is a complete mess/hack - mostly as I had backward compatibility I wanted to keep in save files.

I’ve not yet used the Script Editor to compile a DKUI app, but do use the Rhino Script Compiler CLI tool. I have been asked to make a video to detail the process - watch this space.

DKUI is however built and compiled using the Script Editor, which for GH Python to GH plugins is an amazing tool.

Cheers

DK

3 Likes

@Steven_Kim

Thank you for the suggestion on setting the panel launch location.

On the next release of DKUI there will be two new inputs on the DK Page Server:

page_x
page_y

This will take a factor from 0 to 1.0 as a % of the SCREEN that Rhino is currently on (its aware of multi screen setups) and will position the DKUI at that point every time you ‘show’ the DKUI window.

Also updated on this new component:

The launch input has now been renamed to the show input - toggling this off will hide/close the window.

I have also added a close_rhino input to enable/disable the 'The DKUI window was closed, did you want to close Rhino" dialog.

Cheers

DK

2 Likes

And there you go:

This will be available in the next release - likely tomorrow.

Thanks

DK

1 Like