Comments (3)
I'm happy to work on this. I could be useful to turn it into a project to submit 1 PR at the time. Can I do it or does it need to be someone with write access to the repo?
from doodle.
Java2dWriter
extends both FileWriter
(previously Writer
) and Base64Writer
(previously Base64
). On the other hand Java2dWriter
is a separate object that only uses one function from the Java2dWriter
companion object. I was thinking that it would make sense to:
- Move the companion object to a separate class (say
Java2dWriterUtils
) - separate the logic of
Java2dWriter
into 2 traits:Java2dFileWriter
andJava2dBase64Writer
- Create a separate file called
Writers
that stores all of the actual writer objects (e.gJava2dPdfWriter
,Java2dGifWriter
,Java2dBufferedImageWriter
)
Is that reasonable or is it better to just leave it as Java2dWriter
(because technically it is missleading to call it a Java2dFileWriter
since it is also a Base64Writer
) and have another file Java2dBufferedImageWriter
?
from doodle.
I've created a project: https://github.com/orgs/creativescala/projects/8/
Regarding the refactorings you describe above:
-
Moving the companion object to a class means that code is not usable (and hence not testable) without creating an instance of the class. I'd rather not add this complication if it's not necessary. Some of the code could move into
Java2d
, which handles other parts of rendering using the Java 2D API. -
I'm not sure there is value in separating the implementation of
Java2dWriter
. Conceptually they are distinct, and they are represented by distinct algebras / type classes. However, the implementations are related (i.e. they share a lot of the implementation.) I don't think it's a problem to have the implementations together. The concepts are already distinct, just at a different level of the code. -
This is reasonable.
from doodle.
Related Issues (20)
- Parse hex strings into `Color`
- SVG must not fill open paths HOT 2
- Support perceptually-based color description
- Port minitest tests to munit
- Image saved to file does not have size of Frame HOT 1
- Question: How do we set a shape position relative to a Frame origin HOT 4
- Unexpected behaviour with `Picture` monad and Java2D renderer HOT 2
- Consistent naming of writers HOT 2
- Add tests for `BufferedImageWriter`
- Abstract default frame HOT 3
- Writer conveniences
- Java Implementation Cleanup
- Configurable delay between frames in animated GIF HOT 2
- Allow directly setting the width and height of the bounding box
- Create browser canvas backend
- Canvas backend supports text
- Canvas backend Frame supports background colour
- Canvas backend supports blending modes
- Canvas backend supports fills
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 doodle.