GithubHelp home page GithubHelp logo

jygraphview's Introduction

Pattern showing merge symbols, games controllers and computers in a semi-random formation

Hello there

iOS developer since 2013, currently working on my sleep app in my spare time.

I sometimes write at johnyorke.me and you can also find me on Twitter.

Having a good time...all the time.

jygraphview's People

Contributors

jhurliman avatar johnyorke avatar xslim 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

jygraphview's Issues

Having trouble using it on the watch

I'm trying to use the graphing on the watch but when I copy the four files you mention I'll need it runs into compile error saying that it can't find UIView. From what I read UIView is not available on the WatchKit. I'm trying to compare with your demo app but can't see where/how I can make the changes so that JYGraphView and JYGraphPoint files don't give me errors. Your help is much appreciated.

The mechanism about drawing curving lines

Great work. I have been reading the code and quite interested in

drawCurvedLineBetweenPoints

What is the theory behind the following code? I understand it is drawing curving lines. But I am wondering why the following code draws smooth curving lines. Maths! ;)

    for (int index = 1; index < points.count - 2 ; index++) {

        CGPoint point0 = [self pointAtIndex:index - 1 ofArray:points];
        CGPoint point1 = [self pointAtIndex:index ofArray:points];
        CGPoint point2 = [self pointAtIndex:index + 1 ofArray:points];
        CGPoint point3 = [self pointAtIndex:index + 2 ofArray:points];

        for (int i = 1; i < granularity ; i++) {
            float t = (float) i * (1.0f / (float) granularity);
            float tt = t * t;
            float ttt = tt * t;

            CGPoint pi;
            pi.x = 0.5 * (2*point1.x+(point2.x-point0.x)*t +
                          (2*point0.x-5*point1.x+4*point2.x-point3.x)*tt +
                          (3*point1.x-point0.x-3*point2.x+point3.x)*ttt)
            ;
            pi.y = 0.5 * (2*point1.y+(point2.y-point0.y)*t +
                          (2*point0.y-5*point1.y+4*point2.y-point3.y)*tt +
                          (3*point1.y-point0.y-3*point2.y+point3.y)*ttt);

            if (pi.y > self.graphView.frame.size.height) {
                pi.y = self.graphView.frame.size.height;
            }
            else if (pi.y < 0){
                pi.y = 0;
            }

            if (pi.x > point0.x) {
                [path addLineToPoint:pi];
            }
        }

        [path addLineToPoint:point2];
    }

Append/dynamic values?

Hi. I was wondering if this is set up to handle dynamically adding data. I would like to add real time capabilities to it and wanted to check first if that's something included

Thanks!

Clear View before plot a second time

I have noticed that if you call plotGraphData more than one time, the view maintains the previous drawing plus the new one.
How can avoid this?
I would like use this for a real time graph.
Thank you!

Removing Previously Drawn Graph Lines Without Reallocated (Programmatic Allocation)

Hey guys! I have to first say, this is a GREAT and easy-to-use custom class. A job well done!

One issue I had with it though. When programmatically defining a JYGraphView, and throwing it into a ViewDidLoad, I didn't want to reallocate my instance every time to remove the previously drawn lines with the updated Graph Data. So I created this method inside of JYGraphView. I was going to make a pull request, but I found out this was a private repo. So, here's the code. Figured anyone else that ran into the same problem could use it too:

// Used to clear previously drawn sublayers, or lines, and replots graph
// Be sure to update your JYGraphView's graphData and graphDataLabels before calling this

  • (void)redrawGraphAfterUpdatingGraphData
    {
    [[self layer] setSublayers: nil];
    [self plotGraphData];
    }

Feel free to add this to your repo for JYGraphView!

screen shot 2016-01-25 at 6 46 06 pm

Cocoapod?

It would be great if this library was published as a Cocoapod.

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.