-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theming Approach #35
Comments
I am all for the CSS approach, however, because I'm using Raphaël this is not possible. Raphaël outputs either SVG or VML (on Internet Explorer). The later doesn't support styling with CSS. I think the long term solution is for me to drop Raphaël and use a pure SVG solution. I think Raphaël was a poor choice on my part as I keep getting blocked by it. |
I've started looking to see if there's a way to abstract the drawing On Sunday, May 19, 2013, Andrew Brampton wrote:
dmgcoyle@gmail.com |
I've tried to structure the code to make that possible. For example: HandRaphaëlTheme extends RaphaëlTheme which extends BaseTheme. You can create a new SomethingTheme that extends BaseTheme. Then all the drawing code can go into the draw_line/draw_rect methods, and it should just work. I don't think there is any Raphael specific code in the BaseTheme. |
Ok, great, I'll take a look. On Sunday, May 19, 2013, Andrew Brampton wrote:
dmgcoyle@gmail.com |
+1 |
OK, initial version using svg.js is working on a fork.
Bramp can you take a look and see if you agree it's on the right track before I push on further? |
Awesome, I will look as soon as I can.
|
@de-coy I've had a look at what you are doing, and it's certainly on the right track. I think the game plan here is to finish your svg.js version, and then I'll make js-sequence-diagram support both Raphael and svg.js, but make svg.js the default. Then in future we can support CSS styles, etc. |
Any idea when this will be merged? Or is @de-coy's branch stable enough to be used in production? |
It is definitely not suitable for Production and I'm struggling to fit in On Tuesday, August 27, 2013, Andrew Brampton wrote:
dmgcoyle@gmail.com |
Is there a way to access BaseTheme without modifying sequence-diagram.js? Basically I just want to customize the font as RaphaëlTheme does, but outside the lib. |
Ok since v2.0 we use Snap.svg, which allows styling via CSS! https://github.com/bramp/js-sequence-diagrams#styling I think this can now be closed. |
I've been looking at how to approach themes and wondered if you had any thoughts on it so far. I can think of a couple of approaches:
My thoughts are that option 1 might become unwieldy as the number of theme options grows larger whereas option 2 keeps a nice separation of concerns. The jQuery initialisation would then look something like this:
Any thoughts?
The text was updated successfully, but these errors were encountered: