Comments (3)
I am definitely interested. I was already looking into it, when I thought about exposing Ruby object properties as hierarchical trees (maybe by embedding Firefox's lazy loading object trees and implementing REPS protocol, but that single feature would have multiplied this extension's code).
It would not be too difficult to hard-code a single new visualization type in addition to the existing ones, but in the long-term I need to figure out an interface to make it extendible with more visualizations without blowing up the code.
from sketchup-console-plus.
Can you point me to where I'd start in trying to add such a prototype visualizer? Would it be in Ruby or JS?
from sketchup-console-plus.
The interactivity is added client-side in JavaScript, after tokenization and highlighting (with Ace's highlighter). So the output is already split into colorized HTML tags and annotated with CSS classes depending on the type of token. Look into feature_highlight_entity.js.
- Define a regexp pattern to detect transformations in the output from their Ruby inspect string, and capture its object id. (If the desired string has been split into multiple HTML tags, one can avoid that by adding the string as a new token in mode-ruby_sketchup.js). But
#<Geom::Transformation:...>
is probably a single HTML tag with classsketchup.entity
. - Define a function analog to
addEntityHighlight
that is given the matched HTMLElement and current state of the Regexp object and does something with it. For transformation, you could register an onclick event handler which will toggle a child element containing the matrix table. - In
detectVisualizableElements
, add a pattern match and call that function. - You can register an action callback
dialog.on('get_transformation_matrix') { |action_context, object_id| ... }
in feature_highlight_entity.rb and then do
Bridge.get("get_transformation_matrix", object_id).then(function(matrix){ ... })
where you receive the matrix and generate the HTML table.
from sketchup-console-plus.
Related Issues (20)
- Extension using `.singleton_class`? HOT 9
- Multiple warnings when on a Portuguese version HOT 7
- SketchUp Console+ closes when Geolocating HOT 1
- Error when transfering strings with non-UTF-8 compatible bytes HOT 2
- Tutorials HOT 3
- Warning upon launching Console+ 3.1.3 HOT 5
- Text in some console window is white on pale grey - almost ureadable HOT 1
- Points visualized as vectors? HOT 2
- undefined local variable or method `cp' HOT 1
- Draw 3d normals using view.draw? HOT 2
- super laggy some times
- Promise.then method conflicts with standard ruby in Sketchup 2021
- Documentation search not working?
- Console is lagging even after uninstalling console-plus
- Load error, ruby 3
- Display file paths in error trace as a links
- Sketchup2022(Get a reference to an entity in the model by picking it with the pointer.)not work HOT 1
- ReferenceError: ace is not defined HOT 1
- Intro to Sketchup tutorial fails on first step? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sketchup-console-plus.