Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-du committed Jan 20, 2021
1 parent 1f70e95 commit b124b26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/handler/get_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ pub async fn search(req: Request<()>) -> tide::Result {
if req.query::<Search>().is_ok() {
let query: Search = req.query()?;
let mut wiki_info =
WikiGraphInfo::new(0, query.words.clone(), 3, query.words.clone(), vec![]);
WikiGraphInfo::new(0, query.words.clone(), 2, query.words.clone(), vec![]);

let mut wiki = Wikipedia::<ProxyClient>::default();
// limit page results
if query.limit.is_some() {
wiki.search_results = query.limit.unwrap();
} else {
wiki.search_results = 10
wiki.search_results = 20
}

// limit results
Expand Down Expand Up @@ -84,19 +84,19 @@ pub async fn search(req: Request<()>) -> tide::Result {
};

let mut children =
WikiGraphInfo::new(id, title, 2, page.get_summary().unwrap(), vec![]);
WikiGraphInfo::new(id, title, 1, page.get_summary().unwrap(), vec![]);

let mut index: u32 = 0;
for x in links_iter {
index += 1;
if index > 20 {
if index > 30 {
break;
}
let link_title = x.title;
let wiki_link = WikiGraphInfo::new(
index,
link_title.clone(),
1,
0,
link_title.to_string(),
vec![],
);
Expand Down
6 changes: 3 additions & 3 deletions src/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
<div id="main" class="main">
<h1>Wiki Search</h1>
<div class="search">
<input id="words" type="text" value="rust">
<input id="words" type="text" value="sunspot">
<input id="submit" type="submit" value="Search" onclick="search(document.getElementById('words').value)">
</div>
<script>
Expand Down Expand Up @@ -295,7 +295,7 @@ <h1>Wiki Search</h1>
networkSeries.dataFields.children = "children";

networkSeries.nodes.template.label.text = "{name}"
networkSeries.fontSize = 13;
networkSeries.fontSize = 15;
networkSeries.linkWithStrength = 0;

const nodeTemplate = networkSeries.nodes.template;
Expand All @@ -308,7 +308,7 @@ <h1>Wiki Search</h1>
linkTemplate.strokeWidth = 1;
const linkHoverState = linkTemplate.states.create("hover");
linkHoverState.properties.strokeOpacity = 1;
linkHoverState.properties.strokeWidth = 2;
linkHoverState.properties.strokeWidth = 1;

nodeTemplate.events.on("over", function (event) {
const dataItem = event.target.dataItem;
Expand Down

0 comments on commit b124b26

Please sign in to comment.