Skip to content

Commit

Permalink
change namespace pw to pTopo in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
pointworld committed Oct 10, 2018
1 parent 4675ddd commit a543969
Show file tree
Hide file tree
Showing 40 changed files with 366 additions and 366 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
Note:
- The first version of this project is almost based on [jTopo(v0.4.8)](http://www.jtopo.com/) or [jTopo(v0.4.8)](http://www.jtopo.cn/).
- The first version of Pw is based on ES6.
- The first version of pTopo is based on ES6.
- Sincere thanks to the contributions of the author.
---

# pw
# pTopo
> Give me a point, return you a world.
22 changes: 11 additions & 11 deletions demo/animate.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>animate</title>
<script src="./js/pw.js"></script>
<script src="./js/pTopo.js"></script>
<style>
body {
padding: 0;
Expand All @@ -20,12 +20,12 @@
canvas.height = document.documentElement.clientHeight - 10

window.addEventListener('resize', function () {
canvas.width = document.documentElement.clientWidth
canvas.height = document.documentElement.clientHeight
canvas.width = document.documentElement.clientWidth - 10
canvas.height = document.documentElement.clientHeight - 10
})

const stage = new Pw.Stage(canvas)
const scene = new Pw.Scene(stage)
const stage = new PTopo.Stage(canvas)
const scene = new PTopo.Scene(stage)

stage.frame = 24
scene.background = './img/bg.jpg'
Expand All @@ -41,20 +41,20 @@
]

for (let i = 0; i < animates.length; i++) {
const node = new Pw.Node('node')
const node = new PTopo.Node('node')

node.setCenterLocation(100 + i * 90, 300)
node.fillColor = Pw.util.randomColor()
node.fillColor = PTopo.util.randomColor()

scene.add(node)

new Pw.Animate()
new PTopo.Animate()
.stepByStep(node, animates[i], 3000, true)
.start()
}

function myNode(text, x, y) {
const node = new Pw.Node(text)
const node = new PTopo.Node(text)

node.percent = .8
node.beginDegree = 0
Expand Down Expand Up @@ -86,15 +86,15 @@
const node1 = myNode('self-defined', 355, 151)

node1.percent = .1
new Pw.Animate()
new PTopo.Animate()
.stepByStep(node1, {
percent: 1
}, 5000, true)
.start()

const node2 = myNode('self-defined', 155, 151)

new Pw.Animate()
new PTopo.Animate()
.stepByStep(node2, {
beginDegree: 2 * Math.PI
}, 3000, true)
Expand Down
12 changes: 6 additions & 6 deletions demo/animate_gif.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>animate gif</title>
<script src="./js/pw.js"></script>
<script src="./js/pTopo.js"></script>
<style>
body {
padding: 0;
Expand All @@ -20,18 +20,18 @@
canvas.height = document.documentElement.clientHeight - 10

window.addEventListener('resize', function () {
canvas.width = document.documentElement.clientWidth
canvas.height = document.documentElement.clientHeight
canvas.width = document.documentElement.clientWidth - 10
canvas.height = document.documentElement.clientHeight - 10
})

const stage = new Pw.Stage(canvas)
const scene = new Pw.Scene(stage)
const stage = new PTopo.Stage(canvas)
const scene = new PTopo.Scene(stage)

scene.background = './img/bg.jpg'

stage.frames = 24

const sprite = new Pw.AnimateNode('./img/caizhu.png',1,4,1000,1)
const sprite = new PTopo.AnimateNode('./img/caizhu.png',1,4,1000,1)
sprite.setSize(90,88)
sprite.setLocation(300,250)
sprite.repeatPlay = true
Expand Down
16 changes: 8 additions & 8 deletions demo/beautiful_sky.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>beautiful sky</title>
<script src="./js/pw.js"></script>
<script src="./js/pTopo.js"></script>
<style>
body {
padding: 0;
Expand All @@ -19,12 +19,12 @@
canvas.height = document.documentElement.clientHeight - 10

window.addEventListener('resize', function () {
canvas.width = document.documentElement.clientWidth
canvas.height = document.documentElement.clientHeight
canvas.width = document.documentElement.clientWidth - 10
canvas.height = document.documentElement.clientHeight - 10
})

const stage = new Pw.Stage(canvas)
const scene = new Pw.Scene()
const stage = new PTopo.Stage(canvas)
const scene = new PTopo.Scene()

scene.shadow = true
scene.backgroundColor = '0,0,0'
Expand All @@ -37,12 +37,12 @@
function create_node() {
const x = Math.random() * stage.width
const y = Math.random() * stage.height
const node = new Pw.CircleNode()
const node = new PTopo.CircleNode()
node.vx = Math.random() * 6 - 3
node.vy = Math.random() * 6 - 3
node.radius = Math.random() * 10 + 2
node.mass = node.radius
node.fillColor = Pw.util.randomColor()
node.fillColor = PTopo.util.randomColor()
node.setLocation(x, y)
scene.add(node)
return node
Expand All @@ -69,7 +69,7 @@
const dx = b.x - a.x
const dy = b.y - a.y

const dist = Pw.util.getDistance(a, b)
const dist = PTopo.util.getDistance(a, b)

if (dist < minDist) {
const g = stage.graphics
Expand Down
12 changes: 6 additions & 6 deletions demo/chart_bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>bar chart</title>
<script src="./js/pw.js"></script>
<script src="./js/pTopo.js"></script>
<style>
body {
padding: 0;
Expand All @@ -19,16 +19,16 @@
canvas.height = document.documentElement.clientHeight - 10

window.addEventListener('resize', function () {
canvas.width = document.documentElement.clientWidth
canvas.height = document.documentElement.clientHeight
canvas.width = document.documentElement.clientWidth - 10
canvas.height = document.documentElement.clientHeight - 10
})

const stage = new Pw.Stage(canvas)
const scene = new Pw.Scene(stage)
const stage = new PTopo.Stage(canvas)
const scene = new PTopo.Scene(stage)

scene.background = './img/bg.jpg'

const node = new Pw.BarChartNode()
const node = new PTopo.BarChartNode()

node.height = 320
node.width = 400
Expand Down
12 changes: 6 additions & 6 deletions demo/chart_pie.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>pie chart</title>
<script src="./js/pw.js"></script>
<script src="./js/pTopo.js"></script>
<style>
body {
padding: 0;
Expand All @@ -19,16 +19,16 @@
canvas.height = document.documentElement.clientHeight - 10

window.addEventListener('resize', function () {
canvas.width = document.documentElement.clientWidth
canvas.height = document.documentElement.clientHeight
canvas.width = document.documentElement.clientWidth - 10
canvas.height = document.documentElement.clientHeight - 10
})

const stage = new Pw.Stage(canvas)
const scene = new Pw.Scene(stage)
const stage = new PTopo.Stage(canvas)
const scene = new PTopo.Scene(stage)

scene.background = './img/bg.jpg'

const node = new Pw.PieChartNode()
const node = new PTopo.PieChartNode()

node.shadow = false
node.radius = 100
Expand Down
22 changes: 11 additions & 11 deletions demo/containerGroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>container group</title>
<script src="./js/pw.js"></script>
<script src="./js/pTopo.js"></script>
<style>
body {
padding: 0;
Expand All @@ -24,12 +24,12 @@
canvas.height = document.documentElement.clientHeight
})

const stage = new Pw.Stage(canvas)
const scene = new Pw.Scene()
const stage = new PTopo.Stage(canvas)
const scene = new PTopo.Scene()
scene.background = './img/bg.jpg'
stage.add(scene)

const container = new Pw.Container('边界自动变化')
const container = new PTopo.Container('边界自动变化')

container.textPosition = 'Middle_Center'
container.fontColor = '255, 255, 255'
Expand All @@ -40,28 +40,28 @@
scene.add(container)

for (let i = 0; i < 5; i++) {
const node = new Pw.Node("A_" + i)
const node = new PTopo.Node("A_" + i)
node.textPosition = "Middle_Center"
node.setLocation(300 + Math.random() * 300, 200 + Math.random() * 200)
scene.add(node)
container.add(node)
}

scene.add(new Pw.Link(container.childs[0], container.childs[1]))
scene.add(new Pw.Link(container.childs[2], container.childs[3]))
scene.add(new PTopo.Link(container.childs[0], container.childs[1]))
scene.add(new PTopo.Link(container.childs[2], container.childs[3]))

const flowLayout = Pw.Layout.FlowLayout(10, 10)
const flowLayout = PTopo.Layout.FlowLayout(10, 10)

const gridLayout = Pw.Layout.GridLayout(4, 3)
const gridLayout = PTopo.Layout.GridLayout(4, 3)

const container2 = new Pw.Container('点击切换布局')
const container2 = new PTopo.Container('点击切换布局')
container2.layout = flowLayout
container2.fillColor = '10,10,100'
container2.setBound(10, 10, 300, 200)
scene.add(container2)

for (let i = 0; i < 12; i++) {
const node = new Pw.Node("F_" + i)
const node = new PTopo.Node("F_" + i)
node.textPosition = "Middle_Center"
scene.add(node)
container2.add(node)
Expand Down
Loading

0 comments on commit a543969

Please sign in to comment.