Posts

Alternatives in GNU Emacs - Wheel of time

Image
   Imagine you have a collection of images. Sometimes you want to view them in chronological order. However, chances are these pictures are not taken uniformly over a period of time. In other words, certain periods have more pictures than others. What kind of view can give you - A complete picture of the whole timeline for which pictures are available Time periods when you have more pictures than others An easy way to drill down into any period of interest This is wheel of time view in graph-brain . Since this is just a view and not a rigid directory structure, it allows additional conveniences. e.g. if you only have a single picture in a particular year, clicking on the year will take you directly to the picture. You don't have to navigate through month and day. Lessons Learnt On Linux, you can change the modification time of a file to an older date via touch. Timestamp format is %Y%m%d%H%M.  touch -t 202308281900 file   On Linux, you can obtain file modification time as a timesta

Alternatives in GNU Emacs - Tag Explorer

Image
    Firefox provides the option to add tags to your bookmarks for categorization. These tags are available at this URL. chrome://browser/content/places/places.xhtml   If you want to access the same from GNU Emacs, you should backup as JSON to preserve tag information ( Import and Backup > Backup... ). The command graph-firefox-bookmarks parses this information and presents a graphical view. The command org-open-at-point opens the link in the browser. Code https://github.com/atamariya/tumblesocks/blob/dev/graph-pack.el https://github.com/atamariya/tumblesocks/blob/dev/graph-enclose.el https://github.com/atamariya/tumblesocks/blob/dev/graph-draw.el https://github.com/atamariya/tumblesocks/blob/dev/graph-brain.el    

Alternatives in GNU Emacs - File Explorer

Image
Traditionally, Operating Systems (OS) have had folders as an organization entity for collection of files. Documents, Videos, Photos and Downloads folders cover most of the use-cases. However, if you have used it for some length of time, you'll realize it is not enough. For instance, this blog post is a collection of text, images, videos and web URLs. And while working on this idea, I need all of these at my disposal. Or atleast an easy way to access all these related resources. That's when it clicked to me why some people are gung-ho about org-mode ! Often, it's better to organize files around ideas rather than file types. For a beginner, org-mode might seem daunting. I myself ignored it completely till few days back. Don't worry about learning the syntax in depth. Even if you are not using the advanced features, there's lot to be gained. Here's complete list of types of links you can store in a text file and access it using (org-open-at-point) . ( No

Analyzing 3 Body Problem in GNU Emacs

Image
Node view (left) and Group view (right)     3 Body Problem is a sci-fi series on Netflix. Though this post is more about the analyzing process in GNU Emacs than about the show storyline. This is a work-in-progress . The entry point to the package is M-x graph-brain . Design Decisions Leaf title will be displayed at the center of the circle. If it has an image, it will be displayed at the bottom. Group title is displayed at the top. Information gets fuzzier at a certain density. Around 16 leaves and three levels - root, groups and leaves - seems to be a comfortable threshold. org-roam is being used for the database. Presently, only ID, title, filetags and  link fields are being used. IMAGE is managed as an org-mode property.   The Shape We don't want to restrict the number of characters in the story. Yet we don't want to manually decide their placement on the screen. So we need a shape which can be easily placed based on geometrical calculations. The two simplest options are a

Alternatives in GNU Emacs

Image
  Exploring some alternative ideas in GNU Emacs. Stock Heatmap Index (left) and Sector (right) performance heatmap   The circle radius is proportional to the weight of the stock in the index. The color is a range between green, white and red based on the price movement. This uses circle packing . ;; For drawing tooltip, additional point attributes are required. Properties old-x and old-y are used internally. ;; fill    - Circle color ;; title  - Circle label (Use \n for new line) ;; href - Link ;; text  - Tooltip text (Use \n for new line) (defstruct point x y r old-x old-y fill title href text)   ;; Image is an SVG image. (graph-draw-tree root image)    

Circle Packing Animation in GNU Emacs

Image
  Here's an implementation of circle packing algorithm by Wang et. el. in Elisp. Front chain is the set of circles on the periphery. These are shown as connected by red line in the animation. (require 'graph-pack) (defstruct point x y r)   ;; Define a point (setq p (make-point :x 17 :y 0 :r 16))   ;; Define a list of points (setq points (list p1 p2))   ;; Image is an SVG image. This is used for drawing the animation (optional). The return value is the front chain. This can be further used to generate a circumscribing circle. (graph-pack points image)  ;; Get circumscribing circle (setq p (graph-enclose (graph-pack children)))   Bubble Graph   You can pass a hierarchical tree of points to generate a bubble graph. Only radii of leaf nodes are mandatory. title and fill parameters are used if provided. ;; For drawing additional point attributes are required. Hence this definition is different from above. Properties old-x and old-y are used internally. (defstruct point x y r old-x

SVG Animation in GNU Emacs

Image
  Synchronized Multimedia Integration Language (SMIL) is an SVG extension which allows one to create simple animation without Javascript. Here is a basic implementation for <animate> tag. (require 'svg)   (svg-animation-run)    ;; Exiting the image-mode will cancel the animation.  ;; Following command will also cancel the animation. (svg-animation-cancel)   Code https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/svg.el   References Bat SVG