Giter Site home page Giter Site logo

life-graph's Introduction

Stats

Top Languages Kyle's GitHub stats

Recently Played

Alt text

life-graph's People

Contributors

dependabot[bot] avatar k20shores 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

Watchers

 avatar  avatar

life-graph's Issues

Hints are not properly detected as lying on top of other annotations

Describe the bug
The image below shows that overlaps with hints are not detected.

from lifegraph.lifegraph import Lifegraph, Papersize, random_color, Point, Side
from datetime import date, datetime

if __name__ == '__main__':
    birthday = date(1995, 11, 20)
    g = Lifegraph(birthday, dpi=300, size=Papersize.A4, max_age=100, label_space_epsilon=1)

    g.settings.otherParams["annotation.left.offset"] = 3
    g.settings.otherParams["annotation.right.offset"] = 3

    # same day that I was accepted onto performance team :`)
    g.add_life_event('thing 2', date(2019, 1, 7), '#00008B')
    g.add_life_event('thing 3', date(2018, 12, 8), '#87CEFA')
    g.add_life_event('thing 4', date(2013, 11, 20), '#014421')
    g.add_life_event('thing 5', date(2014, 2, 14), '#DC143C', hint=(25, -5))
    g.add_life_event(r'thing 6', date(2020, 2, 14), (.522, .733, .396))

    now = date(2020, 8, 22)
    g.add_life_event('Today', date(now.year, now.month, now.day), (0.75, 0, 0.75))

    g.add_era("thing 7", date(2001, 8, 24), date(2007, 6, 5), 'r')
    g.add_era("thing 8", date(2007, 8, 24), date(2008, 6, 5), '#00838f')
    g.add_era("thing 9", date(2008, 8, 24), date(2010, 6, 5), 'b')
    g.add_era("thing 10", date(2010, 8, 24), date(2014, 6, 5), '#00838f')
    g.add_era("thing 11", date(2014, 9, 1), date(2018, 12, 14), (80/255, 0, 0), side=Side.LEFT)

    g.add_era_span("thing 12", date(2016, 8, 22), date(2016, 12, 16), '#D2691E', hint=Point(53, 28))

    g.add_title("Title")

    g.show_max_age_label()

    g.save("images/hint_collision.png")

hint_collision

Large annotation spill over the edge.

There is text in the graph produced by the annotation spillover file which shows the first limitation of the annotations. They do not automatically detect when the text is too large and would be printed off-screen.

  • Try to detect when the text does this and insert new lines accordingly.
  • Add a flag to turn this detection off
from lifegraph.lifegraph import Lifegraph, Papersize, Side
from datetime import date

if __name__ == '__main__':
    birthday = date(1990, 11, 1)
    g = Lifegraph(birthday, dpi=300, size=Papersize.A4, max_age=100)

    g.add_title("Time is Not Equal to Money")
    g.show_max_age_label()

    # a random color will be chosen if you don't provide one
    g.add_life_event('My first paycheck', date(2006, 8, 23))

    # colors can be added as hex strings
    # and you can hint at which side you want the text on
    g.add_life_event('Graduated highschool', date(2008, 6, 2), color="#00FF00", side=Side.LEFT)

    # or RGB
    g.add_life_event('First car purchased', date(2010, 7, 14), color = (1, 0, 0))

    g.save("images/annotation_spillover.png")

annotation_spillover

Papersizes

Honestly, I don't know if the paper sizes produced by this are correct. I also don't know how the paper sizes and the DPI play together. If anyone knows this information and can tell me what the relationship is and how to properly set both the page size and DPI if what I am doing is wrong, please let me know. Even links to an article would be appreciated in solving this.

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.