sonsongithub / numsw

Swift library like numpy, playgrounds notebook like jupyter.
MIT License
133 stars 9 forks source link

[3/3] Grouping API #13

Closed omochi closed 7 years ago

omochi commented 7 years ago

grouping api. its opened in #7.

I am now working.

This PR includes #10 for preparation.

omochi commented 7 years ago

this branch now includes #9 and #10

now working

omochi commented 7 years ago

I implemented followings.

and backward compatibility are presented with below.

public func addLine(
    x: [Double], y: [Double])
{
    hold {
        plot(x, y)
    }
}

public func addLine2(
    x: [Double], y: [Double],
    x2: [Double], y2: [Double])
{
    hold {
        plot(x, y)
        scatter(x2, y2)
    }
}

it tells API clearly for us.

After update Contents.swift(preinstalled presentation example code in book), I remove addLine and addLine2.

Ofcourse, if you call plot directly, it runs as hold { plot(x, y) }.

omochi commented 7 years ago

it ready to merge