Giter Site home page Giter Site logo

misohena / el-easydraw Goto Github PK

View Code? Open in Web Editor NEW
479.0 479.0 17.0 4.2 MB

Embedded drawing tool for Emacs

Home Page: https://misohena.jp/blog/2021-09-21-emacs-easy-draw.html

License: GNU General Public License v3.0

Emacs Lisp 100.00%
drawing emacs graphics org-mode svg

el-easydraw's People

Contributors

misohena avatar nxtruong avatar thezeroalpha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

el-easydraw's Issues

Release to melpa?

Thank you for the amazing project! I am wondering whether it will be released to melpa. It would be better to publish there for more visibilities.

Click position offset

The click position seems to be interpreted as slightly to the right of the position of point.

I need to click further just to the left of any buttons or controls to use them. Also, when I click on the panel on the left hand side, the circle denoting the colour is offset to the right of the mouse.

It looks to me as if all the mouse clicks are interpreted as being slightly offset.

Converting edraw to svg

I would like the feature that when C-c C-s is called, the edraw buffer transforms to a link to a file containing the svg of the edraw buffer. Would that be possible? File name should be provided as an input.

Specifically,
[[file:./img/edraw/natsoehunsthaoe]]

Instead of:
[[edraw:data=H4sIAGwElWMAA6WQyw6CMBBFf6UZ11LAR4RQ/gVpKQ3YmlIp/L0jYMSoKxedR2bm3JtmXS+JV9zVDA7HEEgtlKwdg32MTS9sp4xmEAURkOHS6o5B7dw1pdR7H/hdYKykcRiGFEHLSjq0SjffFqMkSeg0hTyzonS/pQcGGMcpVqptGWyqqgLSOWsawUAbLYAozkBwW/jtuSgbac1NcyA0z+R6ZPj41Hs/X8Cc45FFxQjF7DjnqZ0tnDAtRtc+HzX9hxvHL/DpE0wlPvzW/A5xtuxGpQEAAA==]]

Currently, I'm able to save the file as an svg (edraw-editor-export-to-file), but the link remains an edraw link. I'll need to manually insert the image instead.

A simple way will be to have a function that sequentially make this possible:

def save_file_as_svg():
    svg_filename = edraw-editor-export-to-file()
    filename = relativefile(current_directory, svg_filename)
    replace_edraw_link_with_filename(filename)

Make hand writing possible ?

Is it planned in the future to introduce hand writing ?

I have tried with a touchscreen laptop and its pen.

It works well, except that it only draws on the grid points.

Is it possible to tweak the grid size ? with a much greater
number of points so that hand writing could give a decent appearance ?

Regards

edraw context menu interferes with context-menu-mode

The Edraw-editor context menu interferes with context-menu-mode.

Reconstruction:

  • Activate context-menu-mode. This is a global minor mode.
  • Open any org-file with a valid edraw-link and start the edraw-editor for that image.
  • Left-click on any object in the image opens first the context menu of context-menu-mode and not that one of the edraw-editor.

Unable to resolve link "edraw:file ..."

Hi

The regular pdf export (via Latex) is supported by the edraw link?

I have the SVG file and the link to it in the org-mode buffer.
But when I try to export to pdf, the exporting process gives me this error:

Error: user-error ("Unable to resolve link: \"edraw:file=edraw-2023-05-03--13-51-35.svg\"")

Scrolling & Zooming not working for SVG imported from dvisvgm

The paths for the formula from the following svg (generated by dvisvgm) are not visible in Edraw:
pythagorasDvisvgm

So scrolling and zooming is essential to make the paths visible and to edit them.

But, scrolling and zooming the view does not work for those paths.

That is because the paths are not part of the group with id edraw-body which gets the transform property for moving the view.

For reproduction download the above SVG-image, open it with Emacs and edit it with edraw-mode.

Cannot save edits from blank image

After your most recent commit 4d0dc9e to fix issue #5, I can no longer save edits starting from a blank image. When I type [[edraw::]] and then C-c C-o to open the editor, draw something, then C-c C-c to save it (or use the menu to finish edit), I receive an error message "Failed to save. Wrong type argument: arrayp, nil. Discard changes?(yes or no)". If I choose NO then it goes back to editing, and if I choose YES then nothing is saved (empty). However, if I copy data from an existing valid SVG image to start from a non-blank image, then it works, my new edits can be saved.

Improve path smoothing in the free hand tool

Hi,

Do you use the freehand tool with a tablet? I noticed that the smoothing capabilities distort the lines that I draw with the Wacom tablet, especially letters.

Is this something that can be easily improved?

Best regards,

Publish to (Non-GNU) ELPA?

Thanks for this package, it looks really great!

I am the creator of sketch-mode, but I think your package looks much more useful, and, actually, quite impressive.

I saw #2, and your experiences with MELPA.
However, I would guess that the Emacs maintainers themselves would be quite enthusiastic about this package. So I would expect that they would be very happy to try/assist getting this package to ELPA, or (NonGNU ELPA, if you are not willing/able to sign the copyright assignment papers). In my experience, they are very helpful, and quite flexible in accepting packages. Also, if you explain that you don't understand English very well, then probably they will fully understand the difficulties. You can just keep developing the package on github.

Personally, I think it would be great to have this in some official repository because it would be much easier to find (and install). Also, there might be more users who find this package, and maybe there will be users who understand English and Japanese who are willing to contribute to the package, like writing documentation etc.

I would just suggest you to send a message to the Emacs mailing list [email protected], and explain that your English is not so good and put add a link to your package, and just see the reactions. It might even be that someone understands Japanese there.

Anyway, I think it would be a great gift to Emacs and its users. But otherwise, anyway, once again, thanks for this great package!

emacs29 on linux and mac don't work

image

I'm having the error editor already exist, but I don't see the editor anywhere. I believe this issue only happens after upgrading to emac29.

clicking on image to edit removes the image

Hi,
I am creating an image and I finished the edit and it looks as below
image

then, I try to edit it by clicking on the image, i see only following
image

I checked my Messages buffer and i see following
[Select Tool] Click:Select, Drag:Range select or Move, M-Drag:Duplicate and move, S-Click:45-degree, Double Click:Properties
C-c C-c:Finish Edit, C-c C-k:Cancel Edit
Invalid image size (see ‘max-image-size’) [22 times]

once i do cancel edit, i get the image back.
Not sure whats going on

Drawing works but no image shown after finished

Thanks for the great work. This is very exciting. I installed easydraw on Mac OS (Big Sur) with emacs-plus 28.0.50, native compile. The drawing worked perfectly (everything). However, when I finished editing (C-c C-c or selected "Finish edit" from the main menu), the final image is not shown but only a very small empty / white box. When I clicked on the box (or C-c C-o on it), the editor was opened again, the correct image was shown, and I could edit it as usual, so the image was not lost. It just was not shown properly when not being edited. Exporting to HTML worked: the SVG image was shown properly in HTML. Any idea how to fix or debug this problem?

Native compilation

Konishiwa.
This is wonderful.
Many thanks for that. It looks very nicely done.
I'm running Emacs 28.0.5 on linux, package installed with straight

#+begin_src elisp
(straight-use-package
 '(edraw :type git :host github :repo  "misohena/el-easydraw"))
#+end_src

It runs fine.

Perhaps the following will help?
The native compilation provided a bunch of warnings (most packages do).
Here they are :
** Compilation warnings

Warning (comp): edraw-util.el:80:29: Warning: the function ‘edraw-msg’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw.el:1121:18: Warning: reference to free variable ‘edraw-property-editor-tracking-selected-shape’ Disable showing Disable logging
Warning (comp): edraw.el:3327:22: Warning: Unknown slot ‘ref-x’ Disable showing Disable logging
Warning (comp): edraw.el:3328:54: Warning: Unknown slot ‘ref-y’ Disable showing Disable logging
Warning (comp): edraw.el:3340:31: Warning: Unknown slot ‘ref-x’ Disable showing Disable logging
Warning (comp): edraw.el:3341:53: Warning: Unknown slot ‘ref-y’ Disable showing Disable logging
Warning (comp): edraw.el:3568:22: Warning: Unknown slot ‘ref-x’ Disable showing Disable logging
Warning (comp): edraw.el:3571:39: Warning: Unknown slot ‘ref-y’ Disable showing Disable logging
Warning (comp): edraw.el:3907:57: Warning: Unknown slot ‘shape’ Disable showing Disable logging
Warning (comp): edraw.el:3911:26: Warning: Unknown slot ‘ppoint’ Disable showing Disable logging
Warning (comp): edraw-org.el:264:9: Warning: Use keywords rather than deprecated positional arguments to `define-minor-mode' Disable showing Disable logging
Warning (comp): edraw-org.el:335:49: Warning: reference to free variable ‘edraw-org-link-image-map’ Disable showing Disable logging
Warning (comp): edraw-org.el:371:32: Warning: reference to free variable ‘edraw-org-link-image-map’ Disable showing Disable logging
Warning (comp): edraw-org.el:742:10: Warning: the function ‘edraw-dom-element-p’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:734:20: Warning: the function ‘edraw-dom-get-by-id’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:704:16: Warning: the function ‘dom-set-attribute’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:685:14: Warning: the function ‘org-export-read-attribute’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:684:23: Warning: the function ‘org-element-map’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:681:31: Warning: the function ‘org-html-inline-image-p’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:678:22: Warning: the function ‘org-export-get-parent-element’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:659:20: Warning: the function ‘org-export-get-reference’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:650:5: Warning: the function ‘org-html--make-attribute-string’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:648:4: Warning: the function ‘org-html-close-tag’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:562:4: Warning: the function ‘edraw-close’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:560:59: Warning: the function ‘eieio-oref’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:541:21: Warning: the function ‘edraw-msg’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:537:20: Warning: the function ‘edraw-save’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:535:21: Warning: the function ‘edraw-modified-p’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:534:34: Warning: the function ‘edraw-editor-at-input’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:507:20: Warning: the function ‘edraw-encode-svg’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:502:18: Warning: the function ‘edraw-write-svg-to-file’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:476:14: Warning: the function ‘edraw-read-svg-from-file’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:473:8: Warning: the function ‘edraw-decode-svg’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:455:10: Warning: the function ‘edraw-initialize’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:446:23: Warning: the function ‘edraw-editor’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-org.el:206:24: Warning: the function ‘org-element-lineage’ might not be defined at runtime. Disable showing Disable logging
Warning (comp): edraw-color.el:29:1: Warning: ‘(r :initarg :r :accessor edraw-color-r)’ is a malformed function Disable showing Disable logging
Warning (comp): edraw-color.el:29:11: Warning: reference to free variable ‘edraw-color’ Disable showing Disable logging
Warning (comp): edraw-color.el:31:29: Warning: reference to free variable ‘edraw-color-g’ Disable showing Disable logging
Warning (comp): edraw-color.el:32:29: Warning: reference to free variable ‘edraw-color-b’ Disable showing Disable logging
Warning (comp): edraw-color.el:33:29: Warning: reference to free variable ‘edraw-color-a’ Disable showing Disable logging
Warning (comp): edraw-color.el:88:19: Warning: reference to free variable ‘r’ Disable showing Disable logging
Warning (comp): edraw-color.el:89:19: Warning: reference to free variable ‘g’ Disable showing Disable logging
Warning (comp): edraw-color.el:90:19: Warning: reference to free variable ‘b’ Disable showing Disable logging
Warning (comp): edraw-color.el:131:74: Warning: reference to free variable ‘a’ Disable showing Disable logging
Warning (comp): edraw-color.el:94:16: Warning: the function ‘r’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-color.el:94:4: Warning: the function ‘with-slots’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-color.el:88:8: Warning: the function ‘oref’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-color.el:46:4: Warning: the function ‘edraw-color’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-color.el:33:5: Warning: the function ‘a’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-color.el:32:5: Warning: the function ‘b’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-color.el:31:5: Warning: the function ‘g’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-color.el:29:2: Warning: the function ‘defclass’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-dom-svg.el:1029:17: Warning: the function ‘edraw-bezier-segments-contains-point-p’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-dom-svg.el:1025:17: Warning: the function ‘edraw-bezier-segments-intersects-rect-p’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-dom-svg.el:926:9: Warning: the function ‘edraw-path-cmdlist-from-d’ is not known to be defined. Disable showing Disable logging
Warning (comp): edraw-dom-svg.el:925:8: Warning: the function ‘edraw-path-cmdlist-to-segment-list’ is not known to be defined. Disable showing Disable logging
Warning (comp): ~/.emacs.d/straight/build/edraw/edraw-color-picker.el: Error: Symbol's value as variable is void edraw-color Disable showing Disable logging

Hope it helps.
Keep up the good work !

comma/whitespace separators in svg path descriptors arguments are optional

In the SVG Paths specification it is stated that the comma-wsp separators in arguments of path commands are optional.

For an example see the question mark in

moveto-argument-sequence:
    coordinate-pair
    | coordinate-pair comma-wsp? lineto-argument-sequence

So the path descriptor

ZM10 20.1L.1-2e+1 20e1-5e-1

is legal and should be parsed as

((Z) (M 10.0 20.1) (L 0.1 -20.0 200.0 -0.5))

I became aware of this issue when loading svg images generated by dvisvgm --no-fonts=1 with edraw.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.