본문 바로가기

전체 글310

Node.js] xml, rss 파싱 xml : Extensible Markup Language 텍스트 데이터, 계층 구조 xml2js Simple XML to JavaScript object converter. www.npmjs.com xml -> js // 모듈 로드 var parseString = require('xml2js').parseString; // 테스트 용 XML 데이터 var xml = "" + "Banana" + "Apple" + ""; // XML 을 전달 parseString(xml, function (err, result) { // console.log(JSON.stringify(result)); // --- ( ※ 1) // fruits를 제공하는 가게 이름 var shop = result.fruits.$.shop.. 2020. 2. 18.
데이터 시각화 3] NVD3.js , C3.js NVD3 Checkout our examples gallery for how to code your first chart. Our examples should provide you with enough code to start making beautiful charts. Google Chrome is our best supported browser. NVD3 also works in Firefox, Opera, Safari and Internet Explorer nvd3.org 코드보기 더보기 C3.js | D3-based reusable chart library Comfortable C3 makes it easy to generate D3-based charts by wrapping the code r.. 2020. 2. 17.
데이터 시각화2] D3.js D3.js - Data-Driven Documents D3 is a JavaScript library for visualizing data with HTML, SVG, and CSS. d3js.org These are the best JavaScript chart libraries for 2019 First, a brief history: With data collection and use continuing to increase exponentially, the need to visualize this data is becoming more important. Developers seek to consolidate millions of database records into beautiful chart.. 2020. 2. 17.
데이터 시각화1] 차트 만들기 // html Charts | Google Developers Interactive charts for browsers and mobile devices. developers.google.com 라이브러리를 불러놓고 데이터 설정해서 그린다. 전체 코드 보기 더보기 전체 코드 보기 더보기 ㄴㄴㄷㄹ 전체 코드보기 더보기 temperature-data.js var tempData = [["날짜","최고기온","최저기온"],["2020-02-20 00:00",10,1], ["2020-02-21 00:00",11,1],["2020-02-22 00:00",8,3],["2020-02-23 00:00",8,-1], ["2020-02-24 00:00",10,1],["2020-02-25 00:00",10,2],["2020-02-26 0.. 2020. 2. 17.
Node.js] 게시판 만들기4 / 글 수정 기능 (findByIdAndUpdate) Mongoose v5.9.0: API docs mongoosejs.com PostId에 해당하는 글을 가져와서 글의 title은 paramTitle로 contents는 paramContents로 수정한다. ==> postModel.findByIdAndUpdate(Postid, {$set: {title : paramTitle, contents : paramContents}},{ // 업데이트 된 글 수정 var updatePost = function (req, res) { .... if (database){ database.postModel.findByIdAndUpdate(paramPostid,{$set: {title : paramTitle, contents : paramContents, updated_a.. 2020. 2. 14.
Node.js] 게시판 만들기3 // 글 삭제 기능 조회수 늘리는 것 처럼 하면 된다. showpost.ejs 글 삭제 버튼과 전달할 파라미터 설정 routes/post.js 글 삭제 메소드 추가 메소드로 정의해놓은 load로 글 가져와서 delete()로 삭제 후, 파라미터와 함께 redirect // 해당 포스트 삭제 var deletePost = function (req, res) { ... if (database) { database.postModel.load(paramId, function (err, result) { if (err) { .. } if (result) { // 글 삭제 result.delete(); console.log('글 삭제됨 '); // page, perpage 파라미터 전달 후 // 리스트 조회 res.redirect('.. 2020. 2. 13.