Commit 0a395193 authored by Adam Procter's avatar Adam Procter

more attempts

parent c17eabd9
Pipeline #211 failed with stages
in 1 minute and 19 seconds
......@@ -37,19 +37,21 @@ export default {
])
},
props: {
object: Object
//object: Object
},
mounted: function() {
// SVG UI next
var draw = SVG('user-interface').size(600, 300)
var data = [];
let objects = this.allObjects()
//console.log(objects)
objects.forEach((element) => {
data.push(element.__ob__.value.doc)
})
//console.log(data)
var links = draw.group()
var markers = draw.group()
var nodes = draw.group()
......@@ -82,17 +84,17 @@ export default {
fill: colours[Math.floor(Math.random() * colours.length)]
})
}
var type = knowledgeObj.text(element.type)
var title = knowledgeObj.text(element.title)
var uniqueid = knowledgeObj.text(element._id)
// this gets all the ids
knowledgeObjid = element._id
// assign node id to the unique id in database
knowledgeObj.node.id = element._id
console.log(knowledgeObj.node.id)
title.move(0,40)
uniqueid.move(0,80)
// rect_1.connectable({
// container: links,
// markers: markers
......@@ -108,17 +110,38 @@ export default {
// FIXME: determine unique ID of the node that has been moved
// FIXME: associate each node with a knowledge object in the db
// so we have a mapping to record these movements
nodes.mouseup(node => {
// this logs out the final id in the array it doesnt know which one I moved...
// node.clientX and Y is fine different thing
// console.log(node)
console.log(knowledgeObjid)
console.log("x: "+node.clientX)
console.log("y: "+node.clientY)
// nodes.mouseup(node => {
// // this logs out the final id in the array it doesnt know which one I moved...
// // node.clientX and Y is fine different thing
// // console.log(currentTarget)
// // just gets the last id in the list not the one dragged
// console.log(knowledgeObj.native().id)
// this.fill({ color: '#f06' })
// //knowledgeObj.fill({ color: '#f06' })
// console.log("x: "+node.clientX)
// console.log("y: "+node.clientY)
// node.first().remove()
// })
nodes.mouseup((event) => {
// mouse coordinates
console.log(event.clientX, event.clientY)
// the node which was clicked
console.log(event.target)
// the svgjs object
console.log(SVG.adopt(event.target))
// the id
console.log(SVG.adopt(event.target).id())
})
nodes.dblclick(node => {
//isShowing = true
// isShowing = true
// component styled-viewer
if(this.isShowing == false){
this.isShowing = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment